[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug binutils/28173] New: global-buffer-overflow on `nm-new -l`
From: |
shaohua.li at inf dot ethz.ch |
Subject: |
[Bug binutils/28173] New: global-buffer-overflow on `nm-new -l` |
Date: |
Mon, 02 Aug 2021 20:44:17 +0000 |
https://sourceware.org/bugzilla/show_bug.cgi?id=28173
Bug ID: 28173
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 13583
--> https://sourceware.org/bugzilla/attachment.cgi?id=13583&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:
==579==ERROR: AddressSanitizer: global-buffer-overflow on address
0x000001803680 at pc 0x00000154b64f bp 0x7ffd4825bef0 sp 0x7ffd4825bee8
READ of size 8 at 0x000001803680 thread T0
#0 0x154b64e in bfd_perform_relocation
/binutils_latest/repo/bfd/reloc.c:703:23
#1 0x103eb10 in nds32_elf_get_relocated_section_contents
/binutils_latest/repo/bfd/elf32-nds32.c:13100:10
#2 0x4eaa6f in bfd_get_relocated_section_contents
/binutils_latest/repo/bfd/bfd.c:2166:10
#3 0x1551708 in bfd_simple_get_relocated_section_contents
/binutils_latest/repo/bfd/simple.c:298:14
#4 0x6a9f0c in read_section /binutils_latest/repo/bfd/./dwarf2.c:582:7
#5 0x6a6ba7 in _bfd_dwarf2_slurp_debug_info
/binutils_latest/repo/bfd/./dwarf2.c:4737:13
#6 0x6ab131 in _bfd_dwarf2_find_nearest_line
/binutils_latest/repo/bfd/./dwarf2.c:4985:9
#7 0x5d0246 in _bfd_elf_find_line /binutils_latest/repo/bfd/elf.c:9241:10
#8 0x4d1ba0 in print_symbol /binutils_latest/repo/binutils/nm.c:1071:9
#9 0x4ceaeb in print_symbols /binutils_latest/repo/binutils/nm.c:1152:7
#10 0x4cd23c in display_rel_file /binutils_latest/repo/binutils/nm.c:1279:5
#11 0x4c97dd in display_file /binutils_latest/repo/binutils/nm.c:1446:7
#12 0x4c90db in main /binutils_latest/repo/binutils/nm.c:1965:12
#13 0x7f8b6c5b20b2 in __libc_start_main
(/lib/x86_64-linux-gnu/libc.so.6+0x270b2)
#14 0x41c55d in _start (/out_bin/nm-new+0x41c55d)
0x000001803680 is located 224 bytes to the right of global variable
'nds32_elf_howto_table' defined in 'elf32-nds32.c:271:25' (0x1802240) of size
4960
SUMMARY: AddressSanitizer: global-buffer-overflow
/binutils_latest/repo/bfd/reloc.c:703:23 in bfd_perform_relocation
Shadow bytes around the buggy address:
0x0000802f8680: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0000802f8690: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0000802f86a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0000802f86b0: 00 00 00 00 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9
0x0000802f86c0: f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9
=>0x0000802f86d0:[f9]f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9
0x0000802f86e0: f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9
0x0000802f86f0: f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9
0x0000802f8700: f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9
0x0000802f8710: f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9
0x0000802f8720: 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
==579==ABORTING
--
You are receiving this mail because:
You are on the CC list for the bug.
- [Bug binutils/28173] New: global-buffer-overflow on `nm-new -l`,
shaohua.li at inf dot ethz.ch <=