mirror of
https://github.com/chromium/crashpad.git
synced 2025-03-09 14:06:33 +00:00
linux: Don't load section headers of test module
The ELF standard allows substantial flexibility in the construction of valid ELF modules, but there are widely followed conventions. For example, ELF modules typically contain several segments, they do load their program headers, and they don't load their section headers. Bionic contains a variety of checks that the modules it's loading look typical. Beginning with Android M, Bionic refuses to load segments which contain the entire file contents. Change-Id: I0687a3cfd84b3561112dcd32eb6b96493969695e Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2486401 Reviewed-by: Mark Mentovai <mark@chromium.org>
This commit is contained in:
parent
cdb1e7f52b
commit
640b13f3cb
@ -643,16 +643,16 @@ bool WriteTestModule(const base::FilePath& module_path,
|
||||
module.phdr_table.load1.p_type = PT_LOAD;
|
||||
module.phdr_table.load1.p_offset = 0;
|
||||
module.phdr_table.load1.p_vaddr = 0;
|
||||
module.phdr_table.load1.p_filesz = sizeof(module);
|
||||
module.phdr_table.load1.p_memsz = sizeof(module);
|
||||
module.phdr_table.load1.p_filesz = offsetof(decltype(module), shdr_table);
|
||||
module.phdr_table.load1.p_memsz = offsetof(decltype(module), shdr_table);
|
||||
module.phdr_table.load1.p_flags = PF_R;
|
||||
module.phdr_table.load1.p_align = load2_vaddr;
|
||||
|
||||
module.phdr_table.load2.p_type = PT_LOAD;
|
||||
module.phdr_table.load2.p_offset = 0;
|
||||
module.phdr_table.load2.p_vaddr = load2_vaddr;
|
||||
module.phdr_table.load2.p_filesz = sizeof(module);
|
||||
module.phdr_table.load2.p_memsz = sizeof(module);
|
||||
module.phdr_table.load2.p_filesz = offsetof(decltype(module), shdr_table);
|
||||
module.phdr_table.load2.p_memsz = offsetof(decltype(module), shdr_table);
|
||||
module.phdr_table.load2.p_flags = PF_R | PF_W;
|
||||
module.phdr_table.load2.p_align = load2_vaddr;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user