mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 00:27:35 +00:00
LibELF: Ignore PT_GNU_STACK headers
We always map stacks R/W (never X), so we can just ignore this header as far as I understand.
This commit is contained in:
parent
2c5cc189c5
commit
413db2d6d5
2 changed files with 6 additions and 0 deletions
|
@ -197,6 +197,11 @@ bool validate_program_headers(const Elf32_Ehdr& elf_header, size_t file_size, u8
|
|||
return false;
|
||||
}
|
||||
break;
|
||||
case PT_GNU_STACK:
|
||||
if (program_header.p_flags & PF_X) {
|
||||
dbgprintf("Possible shenanigans! Validating an ELF with executable stack.\n");
|
||||
}
|
||||
break;
|
||||
default:
|
||||
// Not handling other program header types in other code so... let's not surprise them
|
||||
dbgprintf("Found program header (%zu) of unrecognized type %x!\n", header_index, program_header.p_type);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue