[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug binutils/24244] New: readelf: heap buffer overflow in unw_decode_ul
From: |
spinpx at gmail dot com |
Subject: |
[Bug binutils/24244] New: readelf: heap buffer overflow in unw_decode_uleb128 |
Date: |
Wed, 20 Feb 2019 08:25:50 +0000 |
https://sourceware.org/bugzilla/show_bug.cgi?id=24244
Bug ID: 24244
Summary: readelf: heap buffer overflow in unw_decode_uleb128
Product: binutils
Version: 2.33 (HEAD)
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: binutils
Assignee: unassigned at sourceware dot org
Reporter: spinpx at gmail dot com
Target Milestone: ---
Created attachment 11624
--> https://sourceware.org/bugzilla/attachment.cgi?id=11624&action=edit
Heap buffer overflow input
- Intel Xeon Gold 5118 processors and 256 GB memory
- Linux n18-065-139 4.19.0-1-amd64 #1 SMP Debian 4.19.12-1 (2018-12-22) x86_64
GNU/Linux
- clang version 4.0.0 (tags/RELEASE_400/final)
- version: commit c72e75a64030b0f6535a80481f37968ad55c333a (Feb 19 2019)
- run: readelf -a input_file
- asan_report:
ELF Header:
Magic: 7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00
Class: ELF32
Data: 2's complement, little endian
Version: 1 (current)
OS/ABI: UNIX - System V
ABI Version: 0
Type: EXEC (Executable file)
Machine: Intel IA-64
Version: 0x1
Entry point address: 0x8048074
Start of program headers: 52 (bytes into file)
Start of section headers: 164 (bytes into file)
Flags: 0x0
Size of this header: 52 (bytes)
Size of program headers: 32 (bytes)
Number of program headers: 2
Size of section headers: 40 (bytes)
Number of section headers: 4
Section header string table index: 3
readelf: Warning: Section 1 has an out of range sh_link value of 512
readelf: Error: Section 3 has invalid sh_entsize of 0000000000000000
readelf: Error: (Using the expected size of 16 for the rest of this dump)
Section Headers:
[Nr] Name Type Addr Off Size ES Flg Lk Inf
Al
[ 0] .IA_64.unwind_inf NULL 00000000 000000 000064 1000000 0
0 4294967268
[ 1] nd_info PROGBITS 08048081 000067 00000c 00 AX 512 0
4
readelf: Warning: section 1: sh_link value of 512 is larger than the number of
sections
[ 2] o IA_64_UNWIND 00049000 000000 00000c 00 WA 0 0
570425348
readelf: Warning: [ 3]: Link field (0) should index a string section.
=================================================================
==427698==ERROR: AddressSanitizer: heap-buffer-overflow on address
0x60b000003225 at pc 0x0000005871b5 bp 0x7ffdc2270470 sp 0x7ffdc2270468
READ of size 1 at 0x60b000003225 thread T0
#0 0x5871b4 in unw_decode_uleb128
/mnt/raid/user/chenpeng/FuzzingBench/binutils/binutils-gdb/binutils/unwind-ia64.c:553:14
#1 0x58464f in unw_decode_r2
/mnt/raid/user/chenpeng/FuzzingBench/binutils/binutils-gdb/binutils/unwind-ia64.c:674:10
#2 0x58430c in unw_decode
/mnt/raid/user/chenpeng/FuzzingBench/binutils/binutils-gdb/binutils/unwind-ia64.c:1072:10
#3 0x55fe61 in dump_ia64_unwind
/mnt/raid/user/chenpeng/FuzzingBench/binutils/binutils-gdb/binutils/readelf.c:7519:7
#4 0x5533a5 in ia64_process_unwind
/mnt/raid/user/chenpeng/FuzzingBench/binutils/binutils-gdb/binutils/readelf.c:7814:6
#5 0x51a1c6 in process_unwind
/mnt/raid/user/chenpeng/FuzzingBench/binutils/binutils-gdb/binutils/readelf.c:9338:14
#6 0x505b0d in process_object
/mnt/raid/user/chenpeng/FuzzingBench/binutils/binutils-gdb/binutils/readelf.c:19275:9
#7 0x4f547d in process_file
/mnt/raid/user/chenpeng/FuzzingBench/binutils/binutils-gdb/binutils/readelf.c:19715:13
#8 0x4f3ec8 in main
/mnt/raid/user/chenpeng/FuzzingBench/binutils/binutils-gdb/binutils/readelf.c:19774:11
#9 0x7fa6d20d609a in __libc_start_main
(/lib/x86_64-linux-gnu/libc.so.6+0x2409a)
#10 0x41d4b9 in _start
(/mnt/raid/user/chenpeng/FuzzingBench/build/asan/install/bin/readelf+0x41d4b9)
0x60b000003225 is located 0 bytes to the right of 101-byte region
[0x60b0000031c0,0x60b000003225)
allocated by thread T0 here:
#0 0x4c41ac in malloc
/scratch/llvm/clang-4/xenial/final/llvm.src/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:66:3
#1 0x4f179f in get_data
/mnt/raid/user/chenpeng/FuzzingBench/binutils/binutils-gdb/binutils/readelf.c:426:9
#2 0x552ff6 in ia64_process_unwind
/mnt/raid/user/chenpeng/FuzzingBench/binutils/binutils-gdb/binutils/readelf.c:7796:33
#3 0x51a1c6 in process_unwind
/mnt/raid/user/chenpeng/FuzzingBench/binutils/binutils-gdb/binutils/readelf.c:9338:14
#4 0x505b0d in process_object
/mnt/raid/user/chenpeng/FuzzingBench/binutils/binutils-gdb/binutils/readelf.c:19275:9
#5 0x4f547d in process_file
/mnt/raid/user/chenpeng/FuzzingBench/binutils/binutils-gdb/binutils/readelf.c:19715:13
#6 0x4f3ec8 in main
/mnt/raid/user/chenpeng/FuzzingBench/binutils/binutils-gdb/binutils/readelf.c:19774:11
#7 0x7fa6d20d609a in __libc_start_main
(/lib/x86_64-linux-gnu/libc.so.6+0x2409a)
SUMMARY: AddressSanitizer: heap-buffer-overflow
/mnt/raid/user/chenpeng/FuzzingBench/binutils/binutils-gdb/binutils/unwind-ia64.c:553:14
in unw_decode_uleb128
Shadow bytes around the buggy address:
0x0c167fff85f0: fa fa fa fa fa fa fd fd fd fd fd fd fd fd fd fd
0x0c167fff8600: fd fd fd fd fa fa fa fa fa fa fa fa 00 00 00 00
0x0c167fff8610: 00 00 00 00 00 00 00 00 05 fa fa fa fa fa fa fa
0x0c167fff8620: fa fa fd fd fd fd fd fd fd fd fd fd fd fd fd fd
0x0c167fff8630: fa fa fa fa fa fa fa fa 00 00 00 00 00 00 00 00
=>0x0c167fff8640: 00 00 00 00[05]fa fa fa fa fa fa fa fa fa fd fd
0x0c167fff8650: fd fd fd fd fd fd fd fd fd fd fd fd fa fa fa fa
0x0c167fff8660: fa fa fa fa fd fd fd fd fd fd fd fd fd fd fd fd
0x0c167fff8670: fd fd fa fa fa fa fa fa fa fa fd fd fd fd fd fd
0x0c167fff8680: fd fd fd fd fd fd fd fd fa fa fa fa fa fa fa fa
0x0c167fff8690: 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
==427698==ABORTING
--
You are receiving this mail because:
You are on the CC list for the bug.
- [Bug binutils/24244] New: readelf: heap buffer overflow in unw_decode_uleb128,
spinpx at gmail dot com <=