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

Fuzzer details

Fuzzer: libusb_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 0 0.0%
gold [1:9] 0 0.0%
yellow [10:29] 0 0.0%
greenyellow [30:49] 0 0.0%
lawngreen 50+ 12 100.%
All colors 12 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
0 0 None 0 6 libusb_alloc_transfer call site: 00003 /src/libusb/libusb/io.c:1308
0 0 None 0 0 libusb_alloc_transfer call site: 00002 /src/libusb/libusb/io.c:1299

Runtime coverage analysis

Covered functions
6
Functions that are reachable but not covered
4
Reachable functions
13
Percentage of reachable functions covered
69.23%
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
/src/libusb_fuzzer.cc 1
io.c 1
./os/threads_posix.h 1
/src/libusb/./libusb/libusb.h 2
/src/libusb/./libusb/os/threads_posix.h 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
op_init /src/libusb/libusb/os/linux_usbfs.c 1 ['struct.libusb_context *'] 8 0 226 45 17 122 0 472 468
libusb_get_bos_descriptor /src/libusb/libusb/descriptor.c 2 ['struct.libusb_device_handle *', 'struct.libusb_bos_descriptor **'] 6 0 175 25 10 104 0 469 357
op_handle_events /src/libusb/libusb/os/linux_usbfs.c 4 ['struct.libusb_context *', 'char *', 'int ', 'int '] 4 0 324 55 19 59 0 278 135
libusb_get_max_alt_packet_size /src/libusb/libusb/core.c 4 ['struct.libusb_device *', 'int ', 'int ', 'char '] 5 0 75 9 4 35 0 189 121
libusb_init /src/libusb/libusb/core.c 1 ['struct.libusb_context **'] 4 0 16 3 2 69 0 232 92
op_submit_transfer /src/libusb/libusb/os/linux_usbfs.c 1 ['struct.usbi_transfer *'] 3 0 95 14 2 26 0 139 63
libusb_hotplug_register_callback /src/libusb/libusb/hotplug.c 9 ['struct.libusb_context *', 'int ', 'int ', 'int ', 'int ', 'int ', 'func_type *', 'char *', 'int *'] 4 0 379 58 23 40 0 167 56
op_reset_device /src/libusb/libusb/os/linux_usbfs.c 1 ['struct.libusb_device_handle *'] 3 0 195 30 11 29 0 127 37

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

Functions statically reachable by fuzzers
64.6%
183/283
Cyclomatic complexity statically reachable by fuzzers
71.4%
1187 / 1661

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/libusb/libusb/os/events_posix.c [] []
/src/libusb/libusb/os/linux_usbfs.h [] []
/src/libusb/./libusb/libusb.h ['libusb_fuzzer'] []
/src/libusb/libusb/./os/events_posix.h [] []
/src/libusb/libusb/os/linux_udev.c [] []
/src/libusb_fuzzer.cc ['libusb_fuzzer'] ['libusb_fuzzer']
/src/libusb/libusb/./libusbi.h [] []
/src/libusb/libusb/io.c ['libusb_fuzzer'] ['libusb_fuzzer']
/src/libusb/libusb/./os/threads_posix.h ['libusb_fuzzer'] []
/src/libusb/libusb/os/threads_posix.c [] []
/src/libusb/libusb/./libusb.h [] []
/src/libusb/libusb/os/linux_usbfs.c [] []
/src/libusb/libusb/hotplug.c [] []
/src/libusb/libusb/descriptor.c [] []
/src/libusb/libusb/sync.c [] []
/src/libusb/./libusb/os/threads_posix.h ['libusb_fuzzer'] []
/src/libusb/libusb/core.c [] []

Directories in report

Directory
/src/
/src/libusb/libusb/
/src/libusb/libusb/./os/
/src/libusb/./libusb/
/src/libusb/./libusb/os/
/src/libusb/libusb/os/
/src/libusb/libusb/./