mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 16:37:35 +00:00
Kernel+LibELF: Allow Non ET_DYN executables to have an interpreter
This commit is contained in:
parent
d64d0451e5
commit
0cb636078a
2 changed files with 0 additions and 8 deletions
|
@ -469,9 +469,6 @@ KResultOr<NonnullRefPtr<FileDescription>> Process::find_elf_interpreter_for_exec
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!interpreter_path.is_empty()) {
|
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
|
#ifdef EXEC_DEBUG
|
||||||
dbg() << "exec(" << path << "): Using program interpreter " << interpreter_path;
|
dbg() << "exec(" << path << "): Using program interpreter " << interpreter_path;
|
||||||
|
|
|
@ -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];
|
auto& program_header = program_header_begin[header_index];
|
||||||
switch (program_header.p_type) {
|
switch (program_header.p_type) {
|
||||||
case PT_INTERP:
|
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!
|
// 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 (program_header.p_offset + program_header.p_filesz > buffer_size) {
|
||||||
if (verbose)
|
if (verbose)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue