Open hy38 opened 1 month ago
Hi, the analyzer reports that your target function is unreachable from the main function. I may be able to fix this issue if you could provide a stack trace of your target bug.
Thank you for your reply :)
Here's the stack trace of lua (CVE-2020-24370), while my target line is ldebug.c:241
root@fa25a91af839:/benchmark# ./bin/ASAN/lua-2020-24370 poc/lua/2020-24370
AddressSanitizer:DEADLYSIGNAL
=================================================================
==11380==ERROR: AddressSanitizer: SEGV on unknown address 0x6198000005d0 (pc 0x7fb6b7951c12 bp 0x7fff99a0c850 sp 0x7fff99a0c008 T0)
==11380==The signal is caused by a READ memory access.
error: failed to decompress '.debug_aranges', zlib is not available
error: failed to decompress '.debug_info', zlib is not available
error: failed to decompress '.debug_abbrev', zlib is not available
error: failed to decompress '.debug_line', zlib is not available
error: failed to decompress '.debug_str', zlib is not available
error: failed to decompress '.debug_loc', zlib is not available
error: failed to decompress '.debug_ranges', zlib is not available
#0 0x7fb6b7951c12 (/lib/x86_64-linux-gnu/libc.so.6+0xbbc12)
#1 0x499241 in __asan_memcpy /src/llvm-project/compiler-rt/lib/asan/asan_interceptors_memintrinsics.cpp:22:3
#2 0x4db93e in lua_getlocal /benchmark/RUNDIR-lua-5.4.0/lua-5.4.0/ldebug.c:241:7
#3 0x556efd in db_getlocal /benchmark/RUNDIR-lua-5.4.0/lua-5.4.0/ldblib.c:218:12
#4 0x4e595a in luaD_call /benchmark/RUNDIR-lua-5.4.0/lua-5.4.0/ldo.c:482:11
#5 0x53a8e6 in luaV_execute /benchmark/RUNDIR-lua-5.4.0/lua-5.4.0/lvm.c:1615:9
#6 0x4e605c in luaD_call /benchmark/RUNDIR-lua-5.4.0/lua-5.4.0/ldo.c:504:7
#7 0x4e6303 in luaD_callnoyield /benchmark/RUNDIR-lua-5.4.0/lua-5.4.0/ldo.c:526:3
#8 0x4d50c1 in lua_callk /benchmark/RUNDIR-lua-5.4.0/lua-5.4.0/lapi.c:979:5
#9 0x554f31 in generic_reader /benchmark/RUNDIR-lua-5.4.0/lua-5.4.0/lbaselib.c:352:3
#10 0x5405ae in luaZ_fill /benchmark/RUNDIR-lua-5.4.0/lua-5.4.0/lzio.c:28:10
#11 0x4e8dba in f_parser /benchmark/RUNDIR-lua-5.4.0/lua-5.4.0/ldo.c:789:11
#12 0x4e2094 in luaD_rawrunprotected /benchmark/RUNDIR-lua-5.4.0/lua-5.4.0/ldo.c:148:3
#13 0x4e8064 in luaD_pcall /benchmark/RUNDIR-lua-5.4.0/lua-5.4.0/ldo.c:749:12
#14 0x4e881e in luaD_protectedparser /benchmark/RUNDIR-lua-5.4.0/lua-5.4.0/ldo.c:813:12
#15 0x4d5f22 in lua_load /benchmark/RUNDIR-lua-5.4.0/lua-5.4.0/lapi.c:1053:12
#16 0x553de2 in luaB_load /benchmark/RUNDIR-lua-5.4.0/lua-5.4.0/lbaselib.c:379:14
#17 0x4e595a in luaD_call /benchmark/RUNDIR-lua-5.4.0/lua-5.4.0/ldo.c:482:11
#18 0x53a8e6 in luaV_execute /benchmark/RUNDIR-lua-5.4.0/lua-5.4.0/lvm.c:1615:9
#19 0x4e605c in luaD_call /benchmark/RUNDIR-lua-5.4.0/lua-5.4.0/ldo.c:504:7
#20 0x4e6303 in luaD_callnoyield /benchmark/RUNDIR-lua-5.4.0/lua-5.4.0/ldo.c:526:3
#21 0x4d5d90 in f_call /benchmark/RUNDIR-lua-5.4.0/lua-5.4.0/lapi.c:997:3
#22 0x4e2094 in luaD_rawrunprotected /benchmark/RUNDIR-lua-5.4.0/lua-5.4.0/ldo.c:148:3
#23 0x4e8064 in luaD_pcall /benchmark/RUNDIR-lua-5.4.0/lua-5.4.0/ldo.c:749:12
#24 0x4d55f3 in lua_pcallk /benchmark/RUNDIR-lua-5.4.0/lua-5.4.0/lapi.c:1023:14
#25 0x4caeb0 in docall /benchmark/RUNDIR-lua-5.4.0/lua-5.4.0/lua.c:139:12
#26 0x4cabd6 in handle_script /benchmark/RUNDIR-lua-5.4.0/lua-5.4.0/lua.c:228:14
#27 0x4c993b in pmain /benchmark/RUNDIR-lua-5.4.0/lua-5.4.0/lua.c:603:7
#28 0x4e595a in luaD_call /benchmark/RUNDIR-lua-5.4.0/lua-5.4.0/ldo.c:482:11
#29 0x4e6303 in luaD_callnoyield /benchmark/RUNDIR-lua-5.4.0/lua-5.4.0/ldo.c:526:3
#30 0x4d5d90 in f_call /benchmark/RUNDIR-lua-5.4.0/lua-5.4.0/lapi.c:997:3
#31 0x4e2094 in luaD_rawrunprotected /benchmark/RUNDIR-lua-5.4.0/lua-5.4.0/ldo.c:148:3
#32 0x4e8064 in luaD_pcall /benchmark/RUNDIR-lua-5.4.0/lua-5.4.0/ldo.c:749:12
#33 0x4d55f3 in lua_pcallk /benchmark/RUNDIR-lua-5.4.0/lua-5.4.0/lapi.c:1023:14
#34 0x4c9200 in main /benchmark/RUNDIR-lua-5.4.0/lua-5.4.0/lua.c:629:12
#35 0x7fb6b78ba082 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24082)
#36 0x41e56d in _start (/benchmark/bin/ASAN/lua-2020-24370+0x41e56d)
AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV (/lib/x86_64-linux-gnu/libc.so.6+0xbbc12)
==11380==ABORTING
Hello,
Thank you for your amazing work :)
I'm facing an error while generating a DFG with Sparrow on Lua.
Settings
The target line is set at
/benchmark/target/line/lua/2020-24370
as follows:/benchmark/run_smake.sh
is set as follows:SLICE_TARGETS is set at
scripts/benchmark.py
as follows:Sparrow is run with the following command:
Running Sparrow
I get the following error with my target line number 241 (ldebug.c:241):
Target Line Number Comparison
I debugged the line numbers for comparison in
slicingUtils.ml
and found that my target line ldebug.c:241 was missing while there exists the buggy function's entry line.I referred #12 and ensured that my target line does not include multiple-lined if-condition. My target function (and line 241) is as below:
Setting an alternative line as target
By setting the target line to the function entry point (line 228) alternatively, I could pass the above "target not found" error. However, I faced another one: "empty list to list_max()"
Could you please give me some insights about this bug?