This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug other/86198] Libbacktrace does not properly work with ".note.gnu.build-id" section


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)

?

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]