This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
[Bug symtab/21126] New: PIE displacement check needs to handle fully NULL'd GNU_RELRO
- From: "dje at google dot com" <sourceware-bugzilla at sourceware dot org>
- To: gdb-prs at sourceware dot org
- Date: Thu, 09 Feb 2017 21:47:19 +0000
- Subject: [Bug symtab/21126] New: PIE displacement check needs to handle fully NULL'd GNU_RELRO
- Auto-submitted: auto-generated
https://sourceware.org/bugzilla/show_bug.cgi?id=21126
Bug ID: 21126
Summary: PIE displacement check needs to handle fully NULL'd
GNU_RELRO
Product: gdb
Version: HEAD
Status: NEW
Severity: normal
Priority: P2
Component: symtab
Assignee: unassigned at sourceware dot org
Reporter: dje at google dot com
Target Milestone: ---
Evidently strip is now fully NULLing out PT_GNU_RELRO segments (as in even the
segment type is changed to PT_NULL).
svr4_exec_displacement needs to be updated to handle this.
There's no real reason to compare absolutely every segment header in this
sanity check (see svr4_exec_displacement), and the cost to the user of
accidentally getting it wrong is severe (completely unusable debug session).
I think it would be better to let the test pass with a loud warning than to
fail.
[Setting aside a better test which is to just compare the build ids.]
See also PR 11786.
/* Strip modifies the flags and alignment of PT_GNU_RELRO.
CentOS-5 has problems with filesz, memsz as well.
See PR 11786. */
if (phdr2[i].p_type == PT_GNU_RELRO)
{
Elf64_External_Phdr tmp_phdr = *phdrp;
Elf64_External_Phdr tmp_phdr2 = *phdr2p;
memset (tmp_phdr.p_filesz, 0, 8);
memset (tmp_phdr.p_memsz, 0, 8);
memset (tmp_phdr.p_flags, 0, 4);
memset (tmp_phdr.p_align, 0, 8);
memset (tmp_phdr2.p_filesz, 0, 8);
memset (tmp_phdr2.p_memsz, 0, 8);
memset (tmp_phdr2.p_flags, 0, 4);
memset (tmp_phdr2.p_align, 0, 8);
if (memcmp (&tmp_phdr, &tmp_phdr2, sizeof (tmp_phdr))
== 0)
continue;
}
--
You are receiving this mail because:
You are on the CC list for the bug.