linux-sunxi / sunxi-tools

A collection of command line tools for ARM devices with Allwinner SoCs.
http://linux-sunxi.org/
GNU General Public License v2.0
579 stars 421 forks source link

A SEGV fault was discovered in bin2fex #187

Open Asteriska001 opened 1 year ago

Asteriska001 commented 1 year ago

Description

A SEGV fault was discovered in function decompile_section /script_bin.c:277:21

Version

Version v1.4 (Lastest commit)

Environment

Ubuntu 18.04, 64bit

Reproduce

Command

git clone the Lastest Version firstly.
make
./bin2fex  ./poc

POC file at the bottom of this report.

ASAN Report

AddressSanitizer:DEADLYSIGNAL
=================================================================
==674==ERROR: AddressSanitizer: SEGV on unknown address 0x7f947bd0a1f8 (pc 0x0000004d4d3c bp 0x7ffd1cfb23b0 sp 0x7ffd1cfb21c0 T0)
==674==The signal is caused by a READ memory access.
    #0 0x4d4d3c in decompile_section /AFLplusplus/my_test/sunxi-tools-master/valid/sunxi-tools-master/script_bin.c:277:21
    #1 0x4d4d3c in script_decompile_bin /AFLplusplus/my_test/sunxi-tools-master/valid/sunxi-tools-master/script_bin.c:351:8
    #2 0x4ca07b in script_parse /AFLplusplus/my_test/sunxi-tools-master/valid/sunxi-tools-master/fexc.c:142:9
    #3 0x4ca07b in main /AFLplusplus/my_test/sunxi-tools-master/valid/sunxi-tools-master/fexc.c:331:13
    #4 0x7f948a9de082 in __libc_start_main /build/glibc-SzIz7B/glibc-2.31/csu/../csu/libc-start.c:308:16
    #5 0x41d3ed in _start (/AFLplusplus/my_test/sunxi-tools-master/valid/sunxi-tools-master/sunxi-fexc+0x41d3ed)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV /AFLplusplus/my_test/sunxi-tools-master/valid/sunxi-tools-master/script_bin.c:277:21 in decompile_section

POC

id_000001,sig_11,src_000000,time_934,op_havoc,rep_2.zip

Any issue plz contact with me: asteriska001@gmail.com OR: twitter: @Asteriska8