From: Nick Clifton Date: Thu, 8 Feb 2018 10:28:25 +0000 (+0000) Subject: Fix a seg-fault in the ELF note parser when a note with an excessively large alignmen... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ef135d4314fd4c2d7da66b9d7b59af4a85b0f7e6;p=binutils-gdb.git Fix a seg-fault in the ELF note parser when a note with an excessively large alignment is encountered. PR 22788 * elf.c (elf_parse_notes): Reject notes with excessuively large alignments. --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 6dd9f4713ba..7462f914c6c 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,9 @@ +2018-02-08 Nick Clifton + + PR 22788 + * elf.c (elf_parse_notes): Reject notes with excessuively large + alignments. + 2018-02-07 Alan Modra Revert 2018-01-17 Alan Modra diff --git a/bfd/elf.c b/bfd/elf.c index dedf35feb3c..db1e076b554 100644 --- a/bfd/elf.c +++ b/bfd/elf.c @@ -11012,6 +11012,8 @@ elf_parse_notes (bfd *abfd, char *buf, size_t size, file_ptr offset, align is less than 4, we use 4 byte alignment. */ if (align < 4) align = 4; + if (align != 4 && align != 8) + return FALSE; p = buf; while (p < buf + size)