PR26574, heap buffer overflow in _bfd_elf_slurp_secondary_reloc_section
authorAlan Modra <amodra@gmail.com>
Fri, 4 Sep 2020 09:49:18 +0000 (19:19 +0930)
committerAlan Modra <amodra@gmail.com>
Fri, 4 Sep 2020 09:59:02 +0000 (19:29 +0930)
commit8642dafaef21aa6747cec01df1977e9c52eb4679
tree7674ac87fdb82a435b63f9d60355a901bfebc3b6
parent1e3b96fd6cf0c7d018083994ad951ccf92aba582
PR26574, heap buffer overflow in _bfd_elf_slurp_secondary_reloc_section

A horribly fuzzed object with section headers inside the ELF header.
Disallow that, and crazy reloc sizes.

PR 26574
* elfcode.h (elf_object_p): Sanity check section header offset.
* elf.c (_bfd_elf_slurp_secondary_reloc_section): Sanity check
sh_entsize.
bfd/ChangeLog
bfd/elf.c
bfd/elfcode.h