Skip to content
This repository has been archived by the owner on Jan 20, 2022. It is now read-only.

Commit

Permalink
[LibOS] Adjust errors in execve()'s corner cases
Browse files Browse the repository at this point in the history
Signed-off-by: Michał Kowalczyk <[email protected]>
  • Loading branch information
mkow committed Aug 16, 2021
1 parent 1a2275e commit 398727e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions LibOS/shim/src/shim_rtld.c
Original file line number Diff line number Diff line change
Expand Up @@ -571,13 +571,15 @@ static int load_elf_header(struct shim_handle* file, ElfW(Ehdr)* ehdr) {
int ret = read_file_fragment(file, ehdr, sizeof(*ehdr), /*offset=*/0);
if (ret < 0) {
errstring = "Failed to read ELF header from %s";
ret = -ENOEXEC;
goto err;
}

ret = check_elf_header(ehdr);
if (ret < 0) {
errstring = "%s is not an ELF executable. Please note that Graphene doesn't support "
"executing scripts as executables.";
ret = -ENOEXEC;
goto err;
}

Expand Down

0 comments on commit 398727e

Please sign in to comment.