asan: buffer overflow in elf32_arm_get_synthetic_symtab
authorAlan Modra <amodra@gmail.com>
Tue, 10 Oct 2023 07:48:18 +0000 (18:18 +1030)
committerAlan Modra <amodra@gmail.com>
Tue, 10 Oct 2023 11:47:29 +0000 (22:17 +1030)
commitae0d827fa483c4e569803d99f8dff14794c63a17
treec2f8e9c4195d771ce9512621c04f92a483ec6295
parentf22f27f46c756e753ab6dcc4df820fdd81e26367
asan: buffer overflow in elf32_arm_get_synthetic_symtab

Guard against fuzzed files where .plt size isn't commensurate with
plt relocations.

* elf32-arm.c (elf32_arm_plt0_size): Add data_size param.
Return -1 if data_size is too small.
(elf32_arm_plt_size): Likewise.  Delete temp var.  Formatting.
(elf32_arm_get_synthetic_symtab): Adjust to suit.
bfd/elf32-arm.c