ELF core file size checks
authorAlan Modra <amodra@gmail.com>
Fri, 29 Oct 2021 04:39:52 +0000 (15:09 +1030)
committerAlan Modra <amodra@gmail.com>
Fri, 29 Oct 2021 06:52:32 +0000 (17:22 +1030)
commitc45c3dba8cc80a41c4e0839df43c435c7aa0996d
tree416b94ca907560ba4ddfebc3b6fa437cf3d44d2c
parentc82ebeb7e6e060dacbaef02933b5f06c10f574f6
ELF core file size checks

Catch fuzzed segments where p_offset + p_filesz wraps, and limit error
output.

* elfcore.h (elf_core_file_p): Rewrite segment checks using
bfd_get_file_size.  Set read_only on file size errors.
* elfcode.h (elf_swap_shdr_in): Don't repeat error message.
bfd/elfcode.h
bfd/elfcore.h