xcoff armap traversal
Fixes an out-of-bounds read vulnerability in XCOFF armap symbol processing.
An oss-fuzz report revealed a bug in the XCOFF armap symbol name matching logic within binutils. The issue could lead to an uninitialized read or a buffer overflow if the armap traversal went past its intended bounds. The patch corrects the loop condition to prevent this.
- proposer
Submitted a patch to fix an out-of-bounds read in XCOFF armap handling.
“oss-fuzz found a bug in code matching armap symbol names against bfds. It's possible to run off the end of the armap, resulting in an unitialised read or if you're really lucky, a read buffer overflow. * coff-rs6000.c (xcoff_write_armap_big): Move armap count test to correct loop.”
In Details
This patch addresses a security vulnerability found by oss-fuzz in the XCOFF (coff-rs6000.c) implementation related to armap symbol processing. The incorrect loop conditions in xcoff_write_armap_big could allow i to exceed orl_count, leading to reads from uninitialized memory or buffer overflows when processing archives. The fix correctly integrates the count check into the loop conditions.
- XCOFF
- eXtended Common Object File Format. An object file format used on IBM RS/6000 and other PowerPC systems.
- armap
- Likely refers to an archive map or a similar data structure used within archive processing.
- oss-fuzz
- A free, open-source fuzzing service provided by Google that helps projects like Binutils find bugs.
- buffer overflow
- A condition where a program attempts to write data beyond the allocated buffer, potentially corrupting adjacent memory.
- uninitialized read
- Accessing memory that has not been assigned a value, leading to unpredictable program behavior.