bug-binutils
[Top][All Lists]
Advanced

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

[Bug binutils/21143] New: readelf segfault - heap buffer overflow, inval


From: thuanpv at comp dot nus.edu.sg
Subject: [Bug binutils/21143] New: readelf segfault - heap buffer overflow, invalid read of size 8
Date: Mon, 13 Feb 2017 09:44:58 +0000

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

            Bug ID: 21143
           Summary: readelf segfault - heap buffer overflow, invalid read
                    of size 8
           Product: binutils
           Version: 2.29 (HEAD)
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: binutils
          Assignee: unassigned at sourceware dot org
          Reporter: thuanpv at comp dot nus.edu.sg
  Target Milestone: ---

Created attachment 9810
  --> https://sourceware.org/bugzilla/attachment.cgi?id=9810&action=edit
Crashing input

Dear all,

This bug was found with AFLGo, a directed version of AFL/AFLFast. Thanks also
to Marcel Böhme. 

This bug was found on Ubuntu 14.04 64-bit & binutils was checkout from main
repository at git://sourceware.org/git/binutils-gdb.git. Its commit is
53f7e8ea7fad1fcff1b58f4cbd74e192e0bcbc1d (Fri Feb 10 00:00:16 2017) 

binutils was built with ASAN using gcc-6.2 and clang-3.4. The configure command
was:

CC=clang CFLAGS="-DFORTIFY_SOURCE=2 -fstack-protector-all
-fsanitize=undefined,address -fno-omit-frame-pointer -g -Wno-error"
../configure --disable-shared --disable-gdb --disable-libdecnumber
--disable-readline --disable-sim

To reproduce:
Download the attached file - bug_9
readelf -R6 bug_9


Valgrind says:
Hex dump of section '.debug_info':
readelf: Error: Unhandled MSP430 reloc type found after SYM_DIFF reloc
readelf: Warning: unable to apply unsupported reloc type 7 to section
.debug_info
==6435== Invalid read of size 8
==6435==    at 0x408B77: target_specific_reloc_handling (readelf.c:11638)
==6435==    by 0x408B77: apply_relocations (readelf.c:12343)
==6435==    by 0x40EAC6: dump_section_as_bytes (readelf.c:12744)
==6435==    by 0x42334D: process_section_contents (readelf.c:13085)
==6435==    by 0x42334D: process_object (readelf.c:16780)
==6435==    by 0x402111: process_file (readelf.c:17154)
==6435==    by 0x402111: main (readelf.c:17225)
==6435==  Address 0x20052040e0 is not stack'd, malloc'd or (recently) free'd
==6435== 
==6435== 
==6435== Process terminating with default action of signal 11 (SIGSEGV)
==6435==  Access not within mapped region at address 0x20052040E0
==6435==    at 0x408B77: target_specific_reloc_handling (readelf.c:11638)
==6435==    by 0x408B77: apply_relocations (readelf.c:12343)
==6435==    by 0x40EAC6: dump_section_as_bytes (readelf.c:12744)
==6435==    by 0x42334D: process_section_contents (readelf.c:13085)
==6435==    by 0x42334D: process_object (readelf.c:16780)
==6435==    by 0x402111: process_file (readelf.c:17154)
==6435==    by 0x402111: main (readelf.c:17225)

ASAN says:
==4286==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x61900000fc00
at pc 0x54aa2e bp 0x7ffd5d8f73b0 sp 0x7ffd5d8f73a8
READ of size 8 at 0x61900000fc00 thread T0
    #0 0x54aa2d in target_specific_reloc_handling
/home/ubuntu/thesis/subjects/binutils-newest/build-asan/binutils/../../binutils/readelf.c:11637
    #1 0x52e6dc in apply_relocations
/home/ubuntu/thesis/subjects/binutils-newest/build-asan/binutils/../../binutils/readelf.c:12343
    #2 0x55de03 in dump_section_as_bytes
/home/ubuntu/thesis/subjects/binutils-newest/build-asan/binutils/../../binutils/readelf.c:12744
    #3 0x4e1531 in process_section_contents
/home/ubuntu/thesis/subjects/binutils-newest/build-asan/binutils/../../binutils/readelf.c:13085
    #4 0x48d610 in process_object
/home/ubuntu/thesis/subjects/binutils-newest/build-asan/binutils/../../binutils/readelf.c:16780
    #5 0x488365 in process_file
/home/ubuntu/thesis/subjects/binutils-newest/build-asan/binutils/../../binutils/readelf.c:17154
    #6 0x4855c3 in main
/home/ubuntu/thesis/subjects/binutils-newest/build-asan/binutils/../../binutils/readelf.c:17225
    #7 0x7f7b0b7baf44 (/lib/x86_64-linux-gnu/libc.so.6+0x21f44)
    #8 0x47ddfc in _start
(/home/ubuntu/thesis/subjects/binutils-newest/build-asan/binutils/readelf+0x47ddfc)

-- 
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]