https://sourceware.org/bugzilla/show_bug.cgi?id=27840
Bug ID: 27840 Summary: heap-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 13431 --> https://sourceware.org/bugzilla/attachment.cgi?id=13431&action=edit poc for `objdump -D` Hi there, I found heap-buffer-overflow issue on objdump (with flag -D) with a crafted executable using a fuzzer. The AddressSanitizer result is as follows: ==78175==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x6020000000d2 at pc 0x0000007c003c bp 0x7ffc8e42def0 sp 0x7ffc8e42dee8 READ of size 1 at 0x6020000000d2 thread T0 #0 0x7c003b in print_insn_tic30 /data/clean/binutils-gdb/opcodes/tic30-dis.c:701:12 #1 0x4dc181 in disassemble_bytes /data/clean/binutils-gdb/binutils/./objdump.c:2814:20 #2 0x4dc181 in disassemble_section /data/clean/binutils-gdb/binutils/./objdump.c:3396:4 #3 0x949f7b in bfd_map_over_sections /data/clean/binutils-gdb/bfd/section.c:1377:5 #4 0x4ce713 in disassemble_data /data/clean/binutils-gdb/binutils/./objdump.c:3540:3 #5 0x4ce713 in dump_bfd /data/clean/binutils-gdb/binutils/./objdump.c:4939:5 #6 0x4cb3d7 in display_object_bfd /data/clean/binutils-gdb/binutils/./objdump.c #7 0x4cb3d7 in display_any_bfd /data/clean/binutils-gdb/binutils/./objdump.c:5091:5 #8 0x4ca686 in display_file /data/clean/binutils-gdb/binutils/./objdump.c:5112:3 #9 0x4ca686 in main /data/clean/binutils-gdb/binutils/./objdump.c:5462:6 #10 0x7f44d088c0b2 in __libc_start_main /build/glibc-eX1tMB/glibc-2.31/csu/../csu/libc-start.c:308:16 #11 0x41c5fd in _start (/data/clean/binutils-gdb/binutils/objdump+0x41c5fd) 0x6020000000d2 is located 0 bytes to the right of 2-byte region [0x6020000000d0,0x6020000000d2) allocated by thread T0 here: #0 0x49785d in malloc (/data/clean/binutils-gdb/binutils/objdump+0x49785d) #1 0x93fa23 in bfd_malloc /data/clean/binutils-gdb/bfd/libbfd.c:289:9 #2 0x4d5a30 in disassemble_section /data/clean/binutils-gdb/binutils/./objdump.c:3154:8 #3 0x949f7b in bfd_map_over_sections /data/clean/binutils-gdb/bfd/section.c:1377:5 SUMMARY: AddressSanitizer: heap-buffer-overflow /data/clean/binutils-gdb/opcodes/tic30-dis.c:701:12 in print_insn_tic30 Shadow bytes around the buggy address: 0x0c047fff7fc0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0c047fff7fd0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0c047fff7fe0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0c047fff7ff0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0c047fff8000: fa fa 00 01 fa fa fd fd fa fa 03 fa fa fa 03 fa =>0x0c047fff8010: fa fa 03 fa fa fa 01 fa fa fa[02]fa fa fa fa fa 0x0c047fff8020: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c047fff8030: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c047fff8040: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c047fff8050: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c047fff8060: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 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 ==78175==ABORTING -- You are receiving this mail because: You are on the CC list for the bug.