mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 22:48:11 +00:00
DynamicLoader: Some ELF data segments were allocated too small
For a data segment that starts at a non-zero offset into a 4KB page and crosses a 4KB page boundary, we were failing to pad the VM allocation, which would cause the memcpy() to fail. Make sure we round the segment bases down, and segment ends up, and the issue goes away.
This commit is contained in:
parent
eb92ec3149
commit
0d3866e84c
2 changed files with 18 additions and 12 deletions
|
@ -103,8 +103,6 @@ private:
|
|||
bool is_load() const { return type() == PT_LOAD; }
|
||||
bool is_dynamic() const { return type() == PT_DYNAMIC; }
|
||||
|
||||
u32 required_load_size() { return ALIGN_ROUND_UP(m_program_header.p_memsz, m_program_header.p_align); }
|
||||
|
||||
private:
|
||||
Elf32_Phdr m_program_header; // Explicitly a copy of the PHDR in the image
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue