Fix a seg-fault in the ELF note parser when a note with an excessively large alignmen...
authorNick Clifton <nickc@redhat.com>
Thu, 8 Feb 2018 10:28:25 +0000 (10:28 +0000)
committerNick Clifton <nickc@redhat.com>
Thu, 8 Feb 2018 10:28:25 +0000 (10:28 +0000)
PR 22788
* elf.c (elf_parse_notes): Reject notes with excessuively large
alignments.

bfd/ChangeLog
bfd/elf.c

index 6dd9f4713ba5d1765008ef48f948dddd92518979..7462f914c6ce5726a2965abf45812289c3a50c4f 100644 (file)
@@ -1,3 +1,9 @@
+2018-02-08  Nick Clifton  <nickc@redhat.com>
+
+       PR 22788
+       * elf.c (elf_parse_notes): Reject notes with excessuively large
+       alignments.
+
 2018-02-07  Alan Modra  <amodra@gmail.com>
 
        Revert 2018-01-17  Alan Modra  <amodra@gmail.com>
index dedf35feb3c468d020025b3528a2c6544107db04..db1e076b554a83be5db6234c11e89d26805fb527 100644 (file)
--- 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)
This page took 0.029787 seconds and 4 git commands to generate.