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

Fuzzer details

Fuzzer: rpc_fuzzer

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 816 76.2%
gold [1:9] 83 7.75%
yellow [10:29] 37 3.45%
greenyellow [30:49] 74 6.91%
lawngreen 50+ 60 5.60%
All colors 1070 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
6 6 1 :

['p11_debug_precond']

12 140 mock_C_Initialize call site: 00000 /src/p11-kit/common/mock.c:449
6 6 1 :

['p11_debug_precond']

6 6 buffer_realloc call site: 00036 /src/p11-kit/common/buffer.c:58
6 6 1 :

['p11_debug_precond']

6 6 p11_dict_set call site: 01045 /src/p11-kit/common/dict.c:161
2 7 4 :

['free', 'p11_dict_iterate', 'next_entry', 'calloc']

2 7 p11_dict_set call site: 01045 /src/p11-kit/common/dict.c:176
2 2 1 :

['strlen']

8 31 p11_buffer_add call site: 00039 /src/p11-kit/common/buffer.c:192
2 2 1 :

['strcmp']

2 7 p11_rpc_server_handle call site: 00996 /src/p11-kit/p11-kit/rpc-server.c:2382
0 12 1 :

['p11_dict_free']

2 130 mock_C_Initialize call site: 00000 /src/p11-kit/common/mock.c:470
0 11 1 :

['buffer_realloc']

0 11 p11_buffer_reset call site: 00120 /src/p11-kit/common/buffer.c:139
0 0 None 26 154 mock_C_Initialize call site: 00000 /src/p11-kit/common/mock.c:420
0 0 None 14 14 parse_environ_flags call site: 00007 /src/p11-kit/common/debug.c:89
0 0 None 12 40 p11_attr_copy call site: 01037 /src/p11-kit/common/attrs.c:535
0 0 None 12 40 p11_attr_copy call site: 01037 /src/p11-kit/common/attrs.c:539

Runtime coverage analysis

Covered functions
99
Functions that are reachable but not covered
138
Reachable functions
210
Percentage of reachable functions covered
34.29%
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/rpc_fuzzer.c 1
common/mock.c 4
common/library.c 8
common/debug.c 4
common/compat.c 1
common/buffer.c 7
p11-kit/virtual.c 1
p11-kit/rpc-server.c 104
common/message.c 3
p11-kit/rpc-message.c 30
common/dict.c 7
common/attrs.c 8

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
p11_kit_remote_serve_tokens /src/p11-kit/p11-kit/rpc-server.c 5 ['char **', 'size_t ', 'struct._CK_FUNCTION_LIST *', 'int ', 'int '] 13 0 580 110 36 486 0 3462 1630
log_C_GetAttributeValue /src/p11-kit/p11-kit/log.c 5 ['struct._CK_X_FUNCTION_LIST *', 'size_t ', 'size_t ', 'struct._CK_ATTRIBUTE *', 'size_t '] 4 0 105 9 3 42 0 311 259
p11_kit_uri_format /src/p11-kit/p11-kit/uri.c 3 ['struct.p11_kit_uri *', 'int ', 'char **'] 4 0 524 134 36 30 0 138 87
mock_C_VerifyMessage /src/p11-kit/common/mock.c 7 ['size_t ', 'char *', 'size_t ', 'char *', 'size_t ', 'char *', 'size_t '] 3 0 61 6 3 18 0 103 75
proxy_C_Initialize /src/p11-kit/p11-kit/proxy.c 2 ['struct._CK_X_FUNCTION_LIST *', 'char *'] 4 0 267 45 14 40 0 264 43
log_C_UnwrapKey /src/p11-kit/p11-kit/log.c 9 ['struct._CK_X_FUNCTION_LIST *', 'size_t ', 'struct._CK_ATTRIBUTE *', 'size_t ', 'char *', 'size_t ', 'struct._CK_ATTRIBUTE *', 'size_t ', 'size_t *'] 3 0 124 9 3 31 0 120 39
mock_C_SignMessage /src/p11-kit/common/mock.c 7 ['size_t ', 'char *', 'size_t ', 'char *', 'size_t ', 'char *', 'size_t *'] 3 0 61 6 3 18 0 103 37

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

Functions statically reachable by fuzzers
7.00%
488 / 7126
Cyclomatic complexity statically reachable by fuzzers
16.0%
3889 / 24768

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/p11-kit/common/constants.c [] []
/src/p11-kit/common/message.c ['rpc_fuzzer'] ['rpc_fuzzer']
/src/p11-kit/p11-kit/conf.c [] []
/src/p11-kit/common/path.c [] []
/src/p11-kit/p11-kit/util.c [] []
/src/p11-kit/common/attrs.c ['rpc_fuzzer'] ['rpc_fuzzer']
/src/p11-kit/p11-kit/messages.c [] []
/src/p11-kit/p11-kit/iter.c [] []
/src/p11-kit/common/dict.c ['rpc_fuzzer'] ['rpc_fuzzer']
/src/p11-kit/p11-kit/uri.c [] []
/src/p11-kit/p11-kit/rpc-message.c ['rpc_fuzzer'] ['rpc_fuzzer']
/src/p11-kit/p11-kit/rpc-client.c [] []
/src/p11-kit/common/mock.c ['rpc_fuzzer'] ['rpc_fuzzer']
/src/p11-kit/common/hash.c [] []
/src/p11-kit/common/debug.c ['rpc_fuzzer'] ['rpc_fuzzer']
/src/p11-kit/./p11-kit/virtual-fixed-generated.h [] []
/src/p11-kit/p11-kit/proxy.c [] []
/src/p11-kit/p11-kit/log.c [] []
/src/p11-kit/p11-kit/filter.c [] []
/src/p11-kit/common/lexer.c [] []
/src/p11-kit/p11-kit/virtual.c ['rpc_fuzzer'] ['rpc_fuzzer']
/src/p11-kit/common/compat.c ['rpc_fuzzer'] ['rpc_fuzzer']
/src/p11-kit/common/argv.c [] []
/src/p11-kit/common/vsock.c [] []
/src/p11-kit/p11-kit/rpc-transport.c [] []
/src/p11-kit/common/buffer.c ['rpc_fuzzer'] ['rpc_fuzzer']
/src/p11-kit/p11-kit/rpc-server.c ['rpc_fuzzer'] ['rpc_fuzzer']
/src/p11-kit/common/library.c ['rpc_fuzzer'] ['rpc_fuzzer']
/src/p11-kit/common/array.c [] []
/src/p11-kit/./fuzz/rpc_fuzzer.c ['rpc_fuzzer'] []
/src/p11-kit/common/url.c [] []
/src/p11-kit/p11-kit/modules.c [] []

Directories in report

Directory
/src/p11-kit/common/
/src/p11-kit/./p11-kit/
/src/p11-kit/p11-kit/
/src/p11-kit/./fuzz/