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

Project functions overview

The following table shows data about each function in the project. The functions included in this table correspond to all functions that exist in the executables of the fuzzers. As such, there may be functions that are from third-party libraries.

For further technical details on the meaning of columns in the below table, please see the Glossary .

Func name Functions filename Args Function call depth Reached by Fuzzers Runtime reached by Fuzzers Combined 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

Fuzzer details

Fuzzer: fuzz_parser

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 9081 88.7%
gold [1:9] 260 2.54%
yellow [10:29] 75 0.73%
greenyellow [30:49] 11 0.10%
lawngreen 50+ 801 7.83%
All colors 10228 100

Fuzz blockers

The following nodes represent call sites where fuzz blockers occur.

Amount of callsites blocked Calltree index Parent function Callsite Largest blocked function
3458 1345 new_head_cell call site: 01345 makeOrderedSetArgs
316 9436 _outCommonTableExpr call site: 09436 _outNode
308 4839 exprLocation call site: 04839 makeRangeVarFromAnyName
283 5919 makeJsonIsPredicate call site: 05919 makeColumnRef
221 1107 list_concat call site: 01107 SplitColQualList
163 5378 makeVacuumRelation call site: 05378 insertSelectOptions
153 6203 makeJsonValueExpr call site: 06203 makeRangeVarFromQualifiedName
147 6500 _outRangeVar call site: 06500 _outTableFunc
143 7718 _outCreateStmt call site: 07718 _outCreateUserMappingStmt
134 839 list_make2_impl call site: 00839 processCASbits
131 7085 _outNode call site: 07085 _outNode
125 5148 makeRangeVar call site: 05148 makeRecursiveViewSelect

Runtime coverage analysis

Covered functions
329
Functions that are reachable but not covered
947
Reachable functions
1244
Percentage of reachable functions covered
23.87%
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
./test/fuzz/fuzz_parser.c 1
src/pg_query_parse.c 4
src/pg_query.c 6
src/postgres/src_backend_utils_mmgr_mcxt.c 24
src/postgres/src_backend_utils_mmgr_aset.c 2
src/postgres/src_backend_utils_mb_mbutils.c 14
src/postgres/src_common_wchar.c 4
src/postgres/src_port_snprintf.c 23
src/postgres/src_port_strerror.c 3
src/postgres/src_backend_utils_error_elog.c 27
./src/postgres/include/utils/palloc.h 1
src/postgres/src_common_stringinfo.c 8
src/postgres/src_common_psprintf.c 2
src/postgres/src_backend_storage_ipc_ipc.c 1
src/postgres/src_backend_tcop_postgres.c 3
src/postgres/src_backend_utils_error_assert.c 1
src/postgres/src_backend_parser_parser.c 6
scan.l 17
scan.c 16
gram.y 43
gram.c 1
./src/postgres/include/port/pg_bitutils.h 3
src/postgres/src_common_kwlookup.c 1
./src/postgres/include/common/kwlookup.h 1
./src/postgres/include/mb/pg_wchar.h 5
src/postgres/src_backend_parser_scansup.c 4
src/postgres/src_backend_utils_adt_numutils.c 1
src/postgres/src_backend_nodes_list.c 18
./src/postgres/include/nodes/nodes.h 1
./src/postgres/include/nodes/pg_list.h 5
src/postgres/src_backend_nodes_value.c 4
src/postgres/src_backend_nodes_makefuncs.c 19
src/postgres/src_backend_commands_define.c 1
src/postgres/src_backend_catalog_namespace.c 1
src/postgres/src_port_pgstrcasecmp.c 1
src/postgres/src_backend_nodes_copyfuncs.c 5
./src/postgres/include/copyfuncs.funcs.c 320
src/postgres/src_backend_nodes_bitmapset.c 3
src/postgres/src_backend_utils_adt_datum.c 3
./src/postgres/include/postgres.h 2
src/postgres/src_backend_utils_adt_expandeddatum.c 3
src/postgres/src_backend_nodes_extensible.c 1
src/postgres/src_backend_nodes_equalfuncs.c 6
./src/postgres/include/equalfuncs.funcs.c 266
src/postgres/src_backend_nodes_nodeFuncs.c 2
src/pg_query_outfuncs_json.c 11
./src/include/pg_query_outfuncs_defs.c 256
./src/include/pg_query_json_helper.c 2
./src/include/pg_query_enum_defs.c 63

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
pg_query__summary_result__unpack /src/libpg_query/protobuf/pg_query.pb-c.c 3 ['N/A', 'size_t', 'N/A'] 5 0 12 3 2 28 0 273 273
pg_query_parse_protobuf /src/libpg_query/src/pg_query_parse.c 2 ['N/A', 'N/A'] 18 0 12 3 2 1283 0 8665 231
raw_expression_tree_walker_impl /src/libpg_query/src/postgres/src_backend_nodes_nodeFuncs.c 3 ['N/A', 'N/A', 'N/A'] 16 0 2057 411 159 84 0 580 159
pg_qsort /src/libpg_query/./src/postgres/include/lib/sort_template.h 4 ['N/A', 'size_t', 'size_t', 'N/A'] 2 0 367 80 30 4 2 73 73
GenerationRealloc /src/libpg_query/src/postgres/src_backend_utils_mmgr_generation.c 3 ['N/A', 'size_t', 'int'] 18 0 78 16 6 117 0 550 68
protobuf_c_message_check /src/libpg_query/vendor/protobuf-c/protobuf-c.c 1 ['N/A'] 2 0 321 77 34 1 1 68 68
protobuf_c_message_pack_to_buffer /src/libpg_query/vendor/protobuf-c/protobuf-c.c 2 ['N/A', 'N/A'] 11 0 151 29 11 37 279 194 59

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

Functions statically reachable by fuzzers
41.0%
1324 / 3227
Cyclomatic complexity statically reachable by fuzzers
67.0%
9242 / 13872

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 Runtime reached by Fuzzers Combined 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/libpg_query/scan.l ['fuzz_parser'] ['fuzz_parser']
/src/libpg_query/./src/postgres/include/equalfuncs.funcs.c ['fuzz_parser'] []
/src/libpg_query/src/postgres/src_backend_nodes_list.c ['fuzz_parser'] ['fuzz_parser']
/src/libpg_query/./src/include/pg_query_enum_defs.c ['fuzz_parser'] []
/src/libpg_query/src/postgres/src_backend_utils_mmgr_alignedalloc.c [] []
/src/libpg_query/src/postgres/src_backend_utils_mmgr_slab.c [] []
/src/libpg_query/gram.c ['fuzz_parser'] ['fuzz_parser']
/src/libpg_query/src/pg_query.c ['fuzz_parser'] ['fuzz_parser']
/src/libpg_query/src/postgres/src_backend_nodes_bitmapset.c ['fuzz_parser'] []
/src/libpg_query/./src/postgres/include/nodes/pg_list.h ['fuzz_parser'] []
/src/libpg_query/src/postgres/src_backend_utils_adt_numutils.c ['fuzz_parser'] ['fuzz_parser']
/src/libpg_query/src/postgres/src_backend_nodes_nodeFuncs.c ['fuzz_parser'] ['fuzz_parser']
/src/libpg_query/src/postgres/src_backend_utils_adt_expandeddatum.c ['fuzz_parser'] []
/src/libpg_query/src/postgres/src_backend_utils_error_assert.c ['fuzz_parser'] []
/src/libpg_query/src/postgres/src_common_stringinfo.c ['fuzz_parser'] ['fuzz_parser']
/src/libpg_query/protobuf/pg_query.pb-c.c [] []
/src/libpg_query/src/postgres/src_backend_utils_mmgr_mcxt.c ['fuzz_parser'] ['fuzz_parser']
/src/libpg_query/src/pg_query_parse.c ['fuzz_parser'] ['fuzz_parser']
/src/libpg_query/src/postgres/src_backend_utils_mb_mbutils.c ['fuzz_parser'] ['fuzz_parser']
/src/libpg_query/src/postgres/src_backend_parser_parser.c ['fuzz_parser'] ['fuzz_parser']
/src/libpg_query/./src/postgres/include/port/simd.h [] []
/src/libpg_query/./src/postgres/include/kwlist_d.h [] []
/src/libpg_query/src/postgres/src_backend_tcop_postgres.c ['fuzz_parser'] []
/src/libpg_query/./src/postgres/include/utils/memutils_internal.h [] []
/src/libpg_query/./src/postgres/include/common/kwlookup.h ['fuzz_parser'] []
/src/libpg_query/src/postgres/src_backend_nodes_copyfuncs.c ['fuzz_parser'] []
/src/libpg_query/./src/postgres/include/mb/pg_wchar.h ['fuzz_parser'] []
/src/libpg_query/./src/postgres/include/utils/palloc.h ['fuzz_parser'] []
/src/libpg_query/src/postgres/src_common_kwlookup.c ['fuzz_parser'] ['fuzz_parser']
/src/libpg_query/src/postgres/src_backend_utils_mmgr_aset.c ['fuzz_parser'] ['fuzz_parser']
/src/libpg_query/src/postgres/src_port_qsort.c [] []
/src/libpg_query/./src/postgres/include/copyfuncs.funcs.c ['fuzz_parser'] []
/src/libpg_query/./src/postgres/include/nodes/nodes.h ['fuzz_parser'] []
/src/libpg_query/src/postgres/src_backend_nodes_extensible.c ['fuzz_parser'] []
/src/libpg_query/scan.c ['fuzz_parser'] ['fuzz_parser']
/src/libpg_query/src/postgres/src_port_pgstrcasecmp.c ['fuzz_parser'] []
/src/libpg_query/src/postgres/src_backend_catalog_namespace.c ['fuzz_parser'] []
/src/libpg_query/src/postgres/src_backend_nodes_equalfuncs.c ['fuzz_parser'] []
/src/libpg_query/src/pg_query_outfuncs_json.c ['fuzz_parser'] ['fuzz_parser']
/src/libpg_query/./src/postgres/include/lib/ilist.h [] []
/src/libpg_query/vendor/protobuf-c/protobuf-c.c [] []
/src/libpg_query/src/pg_query_outfuncs_protobuf.c [] []
/src/libpg_query/./src/include/pg_query_json_helper.c ['fuzz_parser'] []
/src/libpg_query/gram.y ['fuzz_parser'] ['fuzz_parser']
/src/libpg_query/./src/postgres/include/utils/ascii.h [] []
/src/libpg_query/src/postgres/src_backend_utils_error_elog.c ['fuzz_parser'] ['fuzz_parser']
/src/libpg_query/src/postgres/src_backend_utils_mmgr_generation.c [] []
/src/libpg_query/src/postgres/src_backend_commands_define.c ['fuzz_parser'] []
/src/libpg_query/src/postgres/src_common_psprintf.c ['fuzz_parser'] ['fuzz_parser']
/src/libpg_query/./src/include/pg_query_outfuncs_defs.c ['fuzz_parser'] []
/src/libpg_query/src/postgres/src_backend_storage_ipc_ipc.c ['fuzz_parser'] []
/src/libpg_query/./src/postgres/include/lib/sort_template.h [] []
/src/libpg_query/src/postgres/src_backend_utils_adt_datum.c ['fuzz_parser'] []
/src/libpg_query/./src/postgres/include/postgres.h ['fuzz_parser'] []
/src/libpg_query/src/postgres/src_common_wchar.c ['fuzz_parser'] ['fuzz_parser']
/src/libpg_query/src/postgres/src_backend_nodes_makefuncs.c ['fuzz_parser'] ['fuzz_parser']
/src/libpg_query/src/postgres/src_port_pg_bitutils.c [] []
/src/libpg_query/src/postgres/src_backend_nodes_value.c ['fuzz_parser'] ['fuzz_parser']
/src/libpg_query/./src/postgres/include/utils/memutils_memorychunk.h [] []
/src/libpg_query/src/postgres/src_backend_utils_mmgr_bump.c [] []
/src/libpg_query/src/postgres/src_port_strerror.c ['fuzz_parser'] []
/src/libpg_query/./test/fuzz/fuzz_parser.c ['fuzz_parser'] []
/src/libpg_query/src/postgres/src_backend_parser_scansup.c ['fuzz_parser'] ['fuzz_parser']
/src/libpg_query/./src/postgres/include/port/pg_bitutils.h ['fuzz_parser'] []
/src/libpg_query/src/postgres/src_port_snprintf.c ['fuzz_parser'] ['fuzz_parser']

Directories in report

Directory
/src/libpg_query/src/
/src/libpg_query/./src/postgres/include/mb/
/src/libpg_query/./test/fuzz/
/src/libpg_query/protobuf/
/src/libpg_query/./src/postgres/include/utils/
/src/libpg_query/./src/postgres/include/nodes/
/src/libpg_query/./src/postgres/include/port/
/src/libpg_query/./src/include/
/src/libpg_query/./src/postgres/include/common/
/src/libpg_query/
/src/libpg_query/vendor/protobuf-c/
/src/libpg_query/./src/postgres/include/lib/
/src/libpg_query/src/postgres/
/src/libpg_query/./src/postgres/include/