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:
parent
0ff977bd04
commit
69b97fe318
3 changed files with 30 additions and 1 deletions
|
@ -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 };
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue