summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorItamar <itamar8910@gmail.com>2020-12-18 15:50:05 +0200
committerAndreas Kling <kling@serenityos.org>2020-12-24 21:34:51 +0100
commit0cb636078a508c08250b4d65cc999a5f19020c25 (patch)
tree489ba1c9cb5b601d91a359598fcaa249825d40e8
parentd64d0451e56ee349c48393586dcef7454e9d9fc6 (diff)
downloadserenity-0cb636078a508c08250b4d65cc999a5f19020c25.zip
Kernel+LibELF: Allow Non ET_DYN executables to have an interpreter
-rw-r--r--Kernel/Syscalls/execve.cpp3
-rw-r--r--Libraries/LibELF/Validation.cpp5
2 files changed, 0 insertions, 8 deletions
diff --git a/Kernel/Syscalls/execve.cpp b/Kernel/Syscalls/execve.cpp
index e6f5e929b0..a7b1c644c7 100644
--- a/Kernel/Syscalls/execve.cpp
+++ b/Kernel/Syscalls/execve.cpp
@@ -469,9 +469,6 @@ KResultOr<NonnullRefPtr<FileDescription>> Process::find_elf_interpreter_for_exec
}
if (!interpreter_path.is_empty()) {
- // Programs with an interpreter better be relocatable executables or we don't know what to do...
- if (elf_header->e_type != ET_DYN)
- return KResult(-ENOEXEC);
#ifdef EXEC_DEBUG
dbg() << "exec(" << path << "): Using program interpreter " << interpreter_path;
diff --git a/Libraries/LibELF/Validation.cpp b/Libraries/LibELF/Validation.cpp
index 0afa0a54c5..12d7b29d0a 100644
--- a/Libraries/LibELF/Validation.cpp
+++ b/Libraries/LibELF/Validation.cpp
@@ -195,11 +195,6 @@ bool validate_program_headers(const Elf32_Ehdr& elf_header, size_t file_size, co
auto& program_header = program_header_begin[header_index];
switch (program_header.p_type) {
case PT_INTERP:
- if (ET_DYN != elf_header.e_type) {
- if (verbose)
- dbgprintf("Found PT_INTERP header (%zu) in non-DYN ELF object! What? We can't handle this!\n", header_index);
- return false;
- }
// We checked above that file_size was >= buffer size. We only care about buffer size anyway, we're trying to read this!
if (program_header.p_offset + program_header.p_filesz > buffer_size) {
if (verbose)