https://sourceware.org/bugzilla/show_bug.cgi?id=28178
Bug ID: 28178 Summary: global-buffer-overflow on `nm-new -l` Product: binutils Version: 2.38 (HEAD) Status: UNCONFIRMED Severity: normal Priority: P2 Component: binutils Assignee: unassigned at sourceware dot org Reporter: shaohua.li at inf dot ethz.ch Target Milestone: --- Created attachment 13587 --> https://sourceware.org/bugzilla/attachment.cgi?id=13587&action=edit poc Hi there, I found a global-buffer-overflow on `nm-new -l` with a fuzzer. - binutils version: 2.38(Head), commit af51804103a08cd1e12edc4f4a30eec2c5c4f9e8 - Compiler: clang12 - Platform: Ubuntu 18.04.5 LTS, x86_64 - Reproduce: run `nm-new -l poc` AddressSanitizer report: ==668==ERROR: AddressSanitizer: global-buffer-overflow on address 0x000001828d10 at pc 0x0000011250a5 bp 0x7fffbb5830d0 sp 0x7fffbb5830c8 READ of size 8 at 0x000001828d10 thread T0 #0 0x11250a4 in rx_info_to_howto_rela /binutils_latest/repo/bfd/elf32-rx.c:319:25 #1 0x6f7320 in elf_slurp_reloc_table_from_section /binutils_latest/repo/bfd/./elfcode.h:1523:8 #2 0x6f685e in bfd_elf32_slurp_reloc_table /binutils_latest/repo/bfd/./elfcode.h:1609:11 #3 0x5ce0ae in _bfd_elf_canonicalize_reloc /binutils_latest/repo/bfd/elf.c:8577:9 #4 0x4e96db in bfd_canonicalize_reloc /binutils_latest/repo/bfd/bfd.c:1579:10 #5 0x4d2276 in get_relocs /binutils_latest/repo/binutils/nm.c:913:25 #6 0x50e6ba in bfd_map_over_sections /binutils_latest/repo/bfd/section.c:1383:5 #7 0x4d147a in print_symbol /binutils_latest/repo/binutils/nm.c:1037:8 #8 0x4ceaeb in print_symbols /binutils_latest/repo/binutils/nm.c:1152:7 #9 0x4cd23c in display_rel_file /binutils_latest/repo/binutils/nm.c:1279:5 #10 0x4c97dd in display_file /binutils_latest/repo/binutils/nm.c:1446:7 #11 0x4c90db in main /binutils_latest/repo/binutils/nm.c:1965:12 #12 0x7fb5125b10b2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x270b2) #13 0x41c55d in _start (/out_bin/nm-new+0x41c55d) 0x000001828d10 is located 72 bytes to the right of global variable 'rx_elf_howto_table' defined in 'elf32-rx.c:50:25' (0x1827620) of size 5800 SUMMARY: AddressSanitizer: global-buffer-overflow /binutils_latest/repo/bfd/elf32-rx.c:319:25 in rx_info_to_howto_rela Shadow bytes around the buggy address: 0x0000802fd150: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0000802fd160: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0000802fd170: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0000802fd180: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0000802fd190: 00 00 00 00 00 00 00 00 00 f9 f9 f9 f9 f9 f9 f9 =>0x0000802fd1a0: f9 f9[f9]f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 0x0000802fd1b0: f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 0x0000802fd1c0: f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 0x0000802fd1d0: f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 0x0000802fd1e0: f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 0x0000802fd1f0: f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Container overflow: fc Array cookie: ac Intra object redzone: bb ASan internal: fe Left alloca redzone: ca Right alloca redzone: cb Shadow gap: cc ==668==ABORTING -- You are receiving this mail because: You are on the CC list for the bug.