1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 23:17:45 +00:00

LibELF: Disallow the DynamicLinker from linking a static-pie ELF object

The dynamic loader can't reasonably run static-pie ELF. static-pie ELFs
might run executable code that invokes syscalls outside of the defined
syscall memory executable (code) region security measure we implement.

Known examples of static-pie ELF objects are ELF packers, and the actual
system-provided dynamic loader itself.
This commit is contained in:
Liav A 2023-10-28 11:14:00 +03:00 committed by Andrew Kaster
parent 0ff977bd04
commit 69b97fe318
3 changed files with 30 additions and 1 deletions

View file

@ -254,6 +254,8 @@ public:
InitializationFunction init_section_function() const;
Section init_array_section() const;
bool is_pie() const { return m_is_pie; }
bool has_fini_section() const { return m_fini_offset != 0; }
bool has_fini_array_section() const { return m_fini_array_offset != 0; }
Section fini_section() const;
@ -378,6 +380,8 @@ private:
FlatPtr m_relr_relocation_table_offset { 0 };
bool m_is_elf_dynamic { false };
bool m_is_pie { false };
// DT_FLAGS
ElfW(Word) m_dt_flags { 0 };