PR 34159, buffer overflow in fr30_elf_i32_reloc
This patch fixes a buffer overflow in fr30_elf_i32_reloc and removes a FIXME.
This patch addresses a buffer overflow vulnerability in the fr30_elf_i32_reloc function within the binutils library, as reported in PR 34159. It modifies the function to use bfd_elf_generic_reloc when linking relocatable objects (ld -r) and adds a sanity check for the relocation offset. The patch also removes a related FIXME comment.
- proposer
Proposes a fix for a buffer overflow in fr30_elf_i32_reloc and removes a FIXME.
In Details
This patch modifies elf32-fr30.c to address a buffer overflow in the fr30_elf_i20_reloc and fr30_elf_i32_reloc functions. It uses bfd_elf_generic_reloc for ld -r and incorporates a reloc offset sanity check. The code interacts with the BFD library for ELF object file manipulation.
For Context
Binutils is a suite of tools used for manipulating binary files, including executables and object code. A buffer overflow occurs when a program writes data beyond the allocated memory buffer, potentially leading to crashes or security vulnerabilities. This patch fixes a buffer overflow in the binutils library when processing FR30 architecture ELF files, making it more robust and secure.