From 0502d35d916d65279b6afa7399018077efde2659 Mon Sep 17 00:00:00 2001 From: Denis Khalikov Date: Tue, 19 Jun 2018 13:12:36 +0300 Subject: [PATCH] PR other/86198 * elf.c (elf_add): Increase ".note.gnu.build-id" section size checking up to 36 bytes. Change-Id: I5a6046a551395ad61c8013a347c875ad22b33599 --- libbacktrace/ChangeLog | 6 ++++++ libbacktrace/elf.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/libbacktrace/ChangeLog b/libbacktrace/ChangeLog index ad0ab3c..f9497d1 100644 --- a/libbacktrace/ChangeLog +++ b/libbacktrace/ChangeLog @@ -1,3 +1,9 @@ +2018-06-18 Denis Khalikov + + PR other/86198 + * elf.c (elf_add): Increase ".note.gnu.build-id" section size + checking up to 36 bytes. + 2018-01-16 Ian Lance Taylor * elf.c (codes) [GENERATE_FIXED_HUFFMAN_TABLE]: Fix size to be diff --git a/libbacktrace/elf.c b/libbacktrace/elf.c index f923bc2..f44bd08 100644 --- a/libbacktrace/elf.c +++ b/libbacktrace/elf.c @@ -2820,7 +2820,7 @@ elf_add (struct backtrace_state *state, const char *filename, int descriptor, if (note->type == NT_GNU_BUILD_ID && note->namesz == 4 && strncmp (note->name, "GNU", 4) == 0 - && shdr->sh_size < 12 + ((note->namesz + 3) & ~ 3) + note->descsz) + && shdr->sh_size <= 12 + ((note->namesz + 3) & ~ 3) + note->descsz) { buildid_data = ¬e->name[0] + ((note->namesz + 3) & ~ 3); buildid_size = note->descsz; -- 2.7.4