Open fCorleone opened 6 years ago
Another buffer overflow has been detected, it's a heap buffer overflow. I was running program pbc as: ./pbc testcase2 which testcase2 is put at: https://github.com/fCorleone/fuzz_programs/blob/master/pbc/testcase2 and the heap buffer overflow has occurred:
=================================================================
==20500==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x60200000eeb0 at pc 0x00000040a96e bp 0x7ffe53104be0 sp 0x7ffe53104bd0
READ of size 4 at 0x60200000eeb0 thread T0
#0 0x40a96d in _pbcM_ip_new src/map.c:143
#1 0x406c77 in _pbcP_push_enum src/proto.c:83
#2 0x402bf2 in _register_enum src/register.c:52
#3 0x4048e2 in _register_message src/register.c:211
#4 0x404db5 in _register src/register.c:241
#5 0x40553b in _register_no_dependency src/register.c:296
#6 0x405b47 in pbc_register src/register.c:329
#7 0x401d5b in test_des ../test/pbc.c:37
#8 0x401f25 in main ../test/pbc.c:49
#9 0x7fe25d95082f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2082f)
#10 0x401588 in _start (/home/mfc_fuzz/pbc/build/pbc+0x401588)
0x60200000eeb1 is located 0 bytes to the right of 1-byte region [0x60200000eeb0,0x60200000eeb1)
allocated by thread T0 here:
#0 0x7fe25dd92602 in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x98602)
#1 0x40ef56 in _pbcM_malloc src/alloc.c:8
#2 0x402909 in _register_enum src/register.c:39
#3 0x4048e2 in _register_message src/register.c:211
#4 0x404db5 in _register src/register.c:241
#5 0x40553b in _register_no_dependency src/register.c:296
#6 0x405b47 in pbc_register src/register.c:329
#7 0x401d5b in test_des ../test/pbc.c:37
#8 0x401f25 in main ../test/pbc.c:49
#9 0x7fe25d95082f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2082f)
SUMMARY: AddressSanitizer: heap-buffer-overflow src/map.c:143 _pbcM_ip_new
Shadow bytes around the buggy address:
0x0c047fff9d80: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
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[01]fa fa fa 00 00 fa fa fd fd
0x0c047fff9de0: fa fa 00 00 fa fa fd fd fa fa fd fd fa fa fd fd
0x0c047fff9df0: fa fa fd fd fa fa fd fd fa fa 00 00 fa fa fd fd
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
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
==20500==ABORTING
1: A global buffer overflow has been detected
When I was running program pbc, a global buffer overflow has been detected. The input file has been put at :https://github.com/fCorleone/fuzz_programs/blob/master/pbc/testcase1 Details provided by ASAN: