bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug binutils/22060] New: Heap buffer overflow in elf_read_notes()


From: fumfi.255 at gmail dot com
Subject: [Bug binutils/22060] New: Heap buffer overflow in elf_read_notes()
Date: Fri, 01 Sep 2017 07:41:53 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=22060

            Bug ID: 22060
           Summary: Heap buffer overflow in elf_read_notes()
           Product: binutils
           Version: 2.29
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: binutils
          Assignee: unassigned at sourceware dot org
          Reporter: fumfi.255 at gmail dot com
  Target Milestone: ---

Created attachment 10385
  --> https://sourceware.org/bugzilla/attachment.cgi?id=10385&action=edit
POC to trigger heap buffer overflow (objdump)

After some fuzz testing I found a crashing test case.

Version: 2.29

Command: objdump -x -Wl -R -SD objdump_hbo_elf_read_notes

ASAN:

==10130==ERROR: AddressSanitizer: heap-buffer-overflow on address
0x60200000ef4f at pc 0x0000006e843d bp 0x7ffcd41d0ad0 sp 0x7ffcd41d0ac8
WRITE of size 1 at 0x60200000ef4f thread T0
    #0 0x6e843c in elf_read_notes XYZ/binutils-2.29/bfd/elf.c:10991:13
    #1 0x6e843c in bfd_section_from_phdr XYZ/binutils-2.29/bfd/elf.c:2983
    #2 0x6cf1ea in bfd_elf64_core_file_p
XYZ/binutils-2.29/bfd/./elfcore.h:277:11
    #3 0x65bf6c in bfd_check_format_matches
XYZ/binutils-2.29/bfd/format.c:311:14
    #4 0x4e8f3a in display_object_bfd
XYZ/binutils-2.29/binutils/./objdump.c:3621:7
    #5 0x4e8f3a in display_any_bfd XYZ/binutils-2.29/binutils/./objdump.c:3692
    #6 0x4e7d5a in display_file XYZ/binutils-2.29/binutils/./objdump.c:3713:3
    #7 0x4e7d5a in main XYZ/binutils-2.29/binutils/./objdump.c:4015
    #8 0x7fd0529a982f in __libc_start_main
(/lib/x86_64-linux-gnu/libc.so.6+0x2082f)
    #9 0x419d98 in _start (XYZ/binutils-2.29/binutils/objdump+0x419d98)

0x60200000ef4f is located 1 bytes to the left of 1-byte region
[0x60200000ef50,0x60200000ef51)
allocated by thread T0 here:
    #0 0x4b85ac in malloc
/home/llvm/clang-3.9/final/llvm.src/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:64:3
    #1 0x6618b3 in bfd_malloc XYZ/binutils-2.29/bfd/libbfd.c:193:9

SUMMARY: AddressSanitizer: heap-buffer-overflow
XYZ/binutils-2.29/bfd/elf.c:10991:13 in elf_read_notes
Shadow bytes around the buggy address:
  0x0c047fff9d90: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c047fff9da0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c047fff9db0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c047fff9dc0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c047fff9dd0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
=>0x0c047fff9de0: fa fa fa fa fa fa fa fa fa[fa]01 fa fa fa 00 01
  0x0c047fff9df0: fa fa 00 04 fa fa 00 04 fa fa 00 04 fa fa fd fa
  0x0c047fff9e00: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c047fff9e10: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c047fff9e20: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c047fff9e30: 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
  Heap right redzone:      fb
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack partial redzone:   f4
  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
==10130==ABORTING

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]