Fuzz introspector
For issues and ideas: https://github.com/ossf/fuzz-introspector/issues

Fuzzer details

Fuzzer: fuzz_lua

Call tree

The calltree shows the control flow of the fuzzer. This is overlaid with coverage information to display how much of the potential code a fuzzer can reach is in fact covered at runtime. In the following there is a link to a detailed calltree visualisation as well as a bitmap showing a high-level view of the calltree. For further information about these topics please see the glossary for full calltree and calltree overview

Call tree overview bitmap:

The distribution of callsites in terms of coloring is
Color Runtime hitcount Callsite count Percentage
red 0 765 33.6%
gold [1:9] 70 3.08%
yellow [10:29] 150 6.60%
greenyellow [30:49] 106 4.66%
lawngreen 50+ 1181 51.9%
All colors 2272 100

Fuzz blockers

The followings are the branches where fuzzer fails to bypass.

Unique non-covered Complexity Unique Reachable Complexities Unique Reachable Functions All non-covered Complexity All Reachable Complexity Function Name Function Callsite Blocked Branch
4978 9810 4 :

['luaL_callmeta', 'lua_typename', 'lua_type', 'lua_pushfstring']

4978 15446 msghandler call site: 01995 /src/fuzz_lua.c:103
4959 4959 1 :

['luaU_undump']

4973 14513 f_parser call site: 00000 /src/testdir/build/lua-master/source/ldo.c:992
4806 9575 4 :

['luaF_newCclosure', 'luaC_step', '__asan_report_load1', '__asan_memcpy']

4874 9643 lua_pushcclosure call site: 01987 /src/testdir/build/lua-master/source/lapi.c:581
4800 4800 1 :

['codeextraarg']

4802 9606 luaK_setlist call site: 00000 /src/testdir/build/lua-master/source/lcode.c:1812
4800 4800 1 :

['codeextraarg']

4800 9602 luaK_codek call site: 00000 /src/testdir/build/lua-master/source/lcode.c:452
4795 9576 6 :

['__asan_report_load1', 'luaE_resetthread', '__asan_report_store1', 'abort', '__asan_memcpy', 'luaD_throw']

4831 9612 luaD_throw call site: 00427 /src/testdir/build/lua-master/source/ldo.c:116
4787 4787 2 :

['luaH_setint', '__asan_report_load1']

4807 19205 luaH_resize call site: 01252 /src/testdir/build/lua-master/source/ltable.c:561
4781 4781 2 :

['enterinc', 'entergen']

4783 4783 luaC_changemode call site: 01903 /src/testdir/build/lua-master/source/lgc.c:1362
4779 4779 1 :

['rethook']

4829 4829 moveresults call site: 00955 /src/testdir/build/lua-master/source/ldo.c:456
4764 4764 1 :

['luaD_call']

4764 4764 callclosemethod call site: 00962 /src/testdir/build/lua-master/source/lfunc.c:114
233 247 4 :

['traverseweakvalue', 'linkgclist_', 'traverseephemeron', '__asan_handle_no_return']

241 255 traversetable call site: 00271 /src/testdir/build/lua-master/source/lgc.c:547
144 9802 5 :

['lua_copy', 'lua_pushstring', 'lua_rotate', 'strncmp', 'lua_tolstring']

144 19348 pushglobalfuncname call site: 02191 /src/testdir/build/lua-master/source/lauxlib.c:83

Runtime coverage analysis

Covered functions
534
Functions that are reachable but not covered
155
Reachable functions
683
Percentage of reachable functions covered
77.31%
NB: The sum of covered functions and functions that are reachable but not covered need not be equal to Reachable functions . This is because the reachability analysis is an approximation and thus at runtime some functions may be covered that are not included in the reachability analysis. This is a limitation of our static analysis capabilities.
Function name source code lines source lines hit percentage hit

Files reached

filename functions hit
fuzz_lua.c 8
testdir/build/lua-master/source/lauxlib.c 31
testdir/build/lua-master/source/lstate.c 18
testdir/build/lua-master/source/lstring.c 15
testdir/build/lua-master/source/ldo.c 25
testdir/build/lua-master/source/lmem.c 6
testdir/build/lua-master/source/lgc.c 73
testdir/build/lua-master/source/lfunc.c 14
testdir/build/lua-master/source/ltable.c 37
testdir/build/lua-master/source/ltm.c 15
testdir/build/lua-master/source/ldebug.c 34
testdir/build/lua-master/source/lobject.c 18
testdir/build/lua-master/source/lvm.c 25
testdir/build/lua-master/source/llex.c 1
testdir/build/lua-master/source/lapi.c 44
testdir/build/lua-master/source/lzio.c 1

Analyses and suggestions

Optimal target analysis

Remaining optimal interesting functions

The following table shows a list of functions that are optimal targets. Optimal targets are identified by finding the functions that in combination, yield a high code coverage.

Func name Functions filename Arg count Args Function depth hitcount instr count bb count cyclomatic complexity Reachable functions Incoming references total cyclomatic complexity Unreached complexity
lua_resume /src/testdir/build/lua-master/source/ldo.c 4 ['struct.lua_State *', 'struct.lua_State *', 'int', 'int *'] 181 0 746 131 34 304 0 4921 159
lua_dump /src/testdir/build/lua-master/source/lapi.c 4 ['struct.lua_State *', 'func_type *', 'char *', 'int'] 6 0 237 41 7 25 0 132 112
lua_gc /src/testdir/build/lua-master/source/lapi.c 2 ['struct.lua_State *', 'int'] 35 0 1554 263 67 297 0 4834 67
luaL_loadfilex /src/testdir/build/lua-master/source/lauxlib.c 3 ['struct.lua_State *', 'char *', 'char *'] 60 0 521 84 23 583 0 7459 67
lua_setupvalue /src/testdir/build/lua-master/source/lapi.c 3 ['struct.lua_State *', 'int', 'int'] 4 0 926 172 33 16 0 156 48
luaL_ref /src/testdir/build/lua-master/source/lauxlib.c 2 ['struct.lua_State *', 'int'] 47 0 116 15 5 308 0 4875 47
lua_seti /src/testdir/build/lua-master/source/lapi.c 3 ['struct.lua_State *', 'int', 'size_t'] 35 0 1165 215 44 297 0 4824 44
luaL_optinteger /src/testdir/build/lua-master/source/lauxlib.c 3 ['struct.lua_State *', 'int', 'size_t'] 108 0 39 6 3 342 0 5364 37
lua_geti /src/testdir/build/lua-master/source/lapi.c 3 ['struct.lua_State *', 'int', 'size_t'] 35 0 949 172 36 297 0 4816 36
lua_setiuservalue /src/testdir/build/lua-master/source/lapi.c 3 ['struct.lua_State *', 'int', 'int'] 3 0 930 177 35 12 0 99 35

Implementing fuzzers that target the above functions will improve reachability such that it becomes:

Functions statically reachable by fuzzers
91.0%
686 / 756
Cyclomatic complexity statically reachable by fuzzers
94.0%
8989 / 9516

All functions overview

If you implement fuzzers for these functions, the status of all functions in the project will be:

Func name Functions filename Args Function call depth Reached by Fuzzers Fuzzers runtime hit Func lines hit % I Count BB Count Cyclomatic complexity Functions reached Reached by functions Accumulated cyclomatic complexity Undiscovered complexity

Files and Directories in report

This section shows which files and directories are considered in this report. The main reason for showing this is fuzz introspector may include more code in the reasoning than is desired. This section helps identify if too many files/directories are included, e.g. third party code, which may be irrelevant for the threat model. In the event too much is included, fuzz introspector supports a configuration file that can exclude data from the report. See the following link for more information on how to create a config file: link

Files in report

Source file Reached by Covered by
[] []
/src/testdir/build/lua-master/source/lzio.c ['fuzz_lua'] ['fuzz_lua']
/src/testdir/build/lua-master/source/ldebug.c ['fuzz_lua'] ['fuzz_lua']
/src/testdir/build/lua-master/source/lmem.c ['fuzz_lua'] ['fuzz_lua']
/src/testdir/build/lua-master/source/lcode.c [] []
/src/testdir/build/lua-master/source/lapi.c ['fuzz_lua'] ['fuzz_lua']
/src/testdir/build/lua-master/source/lparser.c [] []
/src/testdir/build/lua-master/source/ldump.c [] []
/src/testdir/build/lua-master/source/llex.c ['fuzz_lua'] ['fuzz_lua']
/src/testdir/build/lua-master/source/lvm.c ['fuzz_lua'] ['fuzz_lua']
/src/testdir/build/lua-master/source/lundump.c [] []
/src/testdir/build/lua-master/source/ltm.c ['fuzz_lua'] ['fuzz_lua']
/src/testdir/build/lua-master/source/lobject.c ['fuzz_lua'] ['fuzz_lua']
/src/fuzz_lua.c ['fuzz_lua'] ['fuzz_lua']
/src/testdir/build/lua-master/source/lauxlib.c ['fuzz_lua'] ['fuzz_lua']
/src/testdir/build/lua-master/source/ldo.c ['fuzz_lua'] ['fuzz_lua']
/src/testdir/build/lua-master/source/lfunc.c ['fuzz_lua'] ['fuzz_lua']
/src/testdir/build/lua-master/source/lgc.c ['fuzz_lua'] ['fuzz_lua']
/src/testdir/build/lua-master/source/lstring.c ['fuzz_lua'] ['fuzz_lua']
/src/testdir/build/lua-master/source/ltable.c ['fuzz_lua'] ['fuzz_lua']
/src/testdir/build/lua-master/source/lstate.c ['fuzz_lua'] ['fuzz_lua']

Directories in report

Directory
/src/testdir/build/lua-master/source/
/src/