https://sourceware.org/bugzilla/show_bug.cgi?id=27858
Bug ID: 27858 Summary: global-buffer-overflow on objdump -D Product: binutils Version: 2.37 (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 13444 --> https://sourceware.org/bugzilla/attachment.cgi?id=13444&action=edit poc Hi there, I found a global-buffer-overflow with AddressSanitizer (with compile flag -fsanitize=address) in `objdump -D`. However, the poc won't crash normally compiled binaries. I have attached the poc that triggered the global-buffer-overflow. Compiler: clang12 Reproduce: `objdump -D poc` AddressSanitizer output: ==109643==ERROR: AddressSanitizer: global-buffer-overflow on address 0x000002573510 at pc 0x0000011649d4 bp 0x7ffd80a6e690 sp 0x7ffd80a6e688 READ of size 8 at 0x000002573510 thread T0 #0 0x11649d3 in bfd_perform_relocation /data/clean/binutils-gdb-asan/bfd/reloc.c:703:23 #1 0x116681f in bfd_generic_get_relocated_section_contents /data/clean/binutils-gdb-asan/bfd/reloc.c:8463:10 #2 0x8472aa in bfd_simple_get_relocated_section_contents /data/clean/binutils-gdb-asan/bfd/simple.c:298:14 #3 0x4c8e58 in load_specific_debug_section /data/clean/binutils-gdb-asan/binutils/./objdump.c:3591:13 #4 0x4ded8d in load_separate_debug_files /data/clean/binutils-gdb-asan/binutils/dwarf.c:11377:10 #5 0x4caf96 in dump_bfd /data/clean/binutils-gdb-asan/binutils/./objdump.c:4815:7 #6 0x4cab03 in display_object_bfd /data/clean/binutils-gdb-asan/binutils/./objdump.c #7 0x4cab03 in display_any_bfd /data/clean/binutils-gdb-asan/binutils/./objdump.c:5091:5 #8 0x4c9fb1 in display_file /data/clean/binutils-gdb-asan/binutils/./objdump.c:5112:3 #9 0x4c9fb1 in main /data/clean/binutils-gdb-asan/binutils/./objdump.c:5462:6 #10 0x7fbe70d490b2 in __libc_start_main /build/glibc-eX1tMB/glibc-2.31/csu/../csu/libc-start.c:308:16 #11 0x41c57d in _start (/data/clean/binutils-gdb-asan/binutils/objdump+0x41c57d) 0x000002573510 is located 1864 bytes to the right of global variable 'sh_elf_howto_table' defined in 'elf32-sh.c:73:25' (0x2570d20) of size 8360 SUMMARY: AddressSanitizer: global-buffer-overflow /data/clean/binutils-gdb-asan/bfd/reloc.c:703:23 in bfd_perform_relocation Shadow bytes around the buggy address: 0x0000804a6650: f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 0x0000804a6660: f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 0x0000804a6670: f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 0x0000804a6680: f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 0x0000804a6690: f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 =>0x0000804a66a0: f9 f9[f9]f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 0x0000804a66b0: f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 0x0000804a66c0: 00 00 00 00 00 00 00 00 00 00 00 00 04 f9 f9 f9 0x0000804a66d0: f9 f9 f9 f9 00 02 f9 f9 f9 f9 f9 f9 00 00 00 00 0x0000804a66e0: 00 00 07 f9 f9 f9 f9 f9 00 00 00 00 00 00 00 06 0x0000804a66f0: f9 f9 f9 f9 00 00 00 00 00 00 00 00 07 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 ==109643==ABORTING -- You are receiving this mail because: You are on the CC list for the bug.