This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug other/86198] Libbacktrace does not properly work with ".note.gnu.build-id" section
- From: "d.khalikov at partner dot samsung.com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 19 Jun 2018 13:46:17 +0000
- Subject: [Bug other/86198] Libbacktrace does not properly work with ".note.gnu.build-id" section
- Auto-submitted: auto-generated
- References: <bug-86198-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86198
--- Comment #2 from Denis Khalikov <d.khalikov at partner dot samsung.com> ---
Looks like that feature was implemented by this patch:
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=blobdiff;f=bfd/opncls.c;h=b4d4dcf64643145e71e70dba29cd8208c945ddec;hp=10684d2682da7623f4b2f3426eaa2d2ba0cd85b0;hb=2425a30e406a0523020b7e70abb864a06a45bb97;hpb=620214f742f7816e2844e1bb7f78a7a684431927
As I understood that code right, it takes "error" branch if size of the section
less than 0x24.
if (size < 0x24)
{
bfd_set_error (bfd_error_invalid_operation);
return NULL;
}
The libbacktrace instead verifies the section to be less than 0x24, should we
change it
from:
2871 && shdr->sh_size < 12 + ((note->namesz + 3) & ~ 3) +
note->descsz)
to:
2871 && shdr->sh_size == 12 + ((note->namesz + 3) & ~ 3) +
note->descsz)
?