diff --git a/LibOS/shim/src/shim_rtld.c b/LibOS/shim/src/shim_rtld.c index 27838a312d..85e187bf03 100644 --- a/LibOS/shim/src/shim_rtld.c +++ b/LibOS/shim/src/shim_rtld.c @@ -571,6 +571,7 @@ 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; } @@ -578,6 +579,7 @@ static int load_elf_header(struct shim_handle* file, ElfW(Ehdr)* 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; }