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: terminal_parser_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 72 62.0%
gold [1:9] 0 0.0%
yellow [10:29] 0 0.0%
greenyellow [30:49] 0 0.0%
lawngreen 50+ 44 37.9%
All colors 116 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
18 73 append_or_delete(std::shared_ptr , std::vector , std::allocator > >&) call site: 00073
16 45 Parser::State::anywhere_rule(wchar_t) const call site: 00045
7 25 Parser::State::anywhere_rule(wchar_t) const call site: 00025 __clang_call_terminate
7 106 LLVMFuzzerTestOneInput call site: 00106 __clang_call_terminate
5 19 Parser::Transition::Transition(std::shared_ptr , Parser::State*) call site: 00019 __clang_call_terminate
4 33 Parser::State::anywhere_rule(wchar_t) const call site: 00033
3 5 LLVMFuzzerTestOneInput call site: 00005
3 14 Parser::State::anywhere_rule(wchar_t) const call site: 00014
3 38 Parser::Transition::Transition(Parser::State*, std::shared_ptr ) call site: 00038
2 62 Parser::State::anywhere_rule(wchar_t) const call site: 00062
1 69 Parser::State::input(wchar_t) const call site: 00069
1 100 Parser::UTF8Parser::input(char, std::vector , std::allocator > >&) call site: 00100 __assert_fail

Runtime coverage analysis

Covered functions
48
Functions that are reachable but not covered
96
Reachable functions
119
Percentage of reachable functions covered
19.33%
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/mosh/src/fuzz/terminal_parser_fuzzer.cc 1
/src/mosh/src/terminal/parser.cc 4
/src/mosh/src/terminal/../../src/terminal/parser.h 1
/usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_vector.h 14
/src/mosh/src/terminal/parserstate.cc 2
/usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/shared_ptr.h 7
/usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/shared_ptr_base.h 15
/src/mosh/src/terminal/./parsertransition.h 3
/src/mosh/src/terminal/../../src/terminal/parsertransition.h 1
/usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_iterator.h 3
/usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/vector.tcc 1
/usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/new_allocator.h 3
/src/mosh/src/fuzz/../../src/terminal/parser.h 2

Fuzzer: terminal_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 534 80.9%
gold [1:9] 0 0.0%
yellow [10:29] 0 0.0%
greenyellow [30:49] 0 0.0%
lawngreen 50+ 126 19.0%
All colors 660 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
62 1 LLVMFuzzerTestOneInput call site: 00001 setupterm
55 355 Terminal::Cell::Cell(unsigned int) call site: 00355 __clang_call_terminate
39 411 Terminal::Display::new_frame[abi:cxx11](bool, Terminal::Framebuffer const&, Terminal::Framebuffer const&) const call site: 00411
38 500 Terminal::Hyperlink::operator!=(Terminal::Hyperlink const&) const call site: 00500 __assert_fail
36 562 Terminal::Display::put_row(bool, Terminal::FrameState&, Terminal::Framebuffer const&, int, Terminal::Row const&, bool) const call site: 00562 snprintf
33 249 Terminal::Display::new_frame[abi:cxx11](bool, Terminal::Framebuffer const&, Terminal::Framebuffer const&) const call site: 00249 wcrtomb
32 466 Terminal::FrameState::update_rendition(Terminal::Renditions const&, bool) call site: 00466 snprintf
24 80 Terminal::DrawState::DrawState(int, int) call site: 00080 __clang_call_terminate
22 637 LLVMFuzzerTestOneInput call site: 00637 __clang_call_terminate
18 134 Terminal::Framebuffer::Framebuffer(int, int) call site: 00134 __clang_call_terminate
18 333 Terminal::Display::new_frame[abi:cxx11](bool, Terminal::Framebuffer const&, Terminal::Framebuffer const&) const call site: 00333
17 153 Terminal::Framebuffer::Framebuffer(int, int) call site: 00153 __clang_call_terminate

Runtime coverage analysis

Covered functions
67
Functions that are reachable but not covered
506
Reachable functions
601
Percentage of reachable functions covered
15.81%
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/mosh/src/fuzz/terminal_fuzzer.cc 1
/src/mosh/src/terminal/terminaldisplayinit.cc 3
/usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/basic_string.h 2
/usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/new_allocator.h 18
/usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/char_traits.h 1
/usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/basic_string.tcc 3
/src/mosh/src/fuzz/../../src/statesync/completeterminal.h 3
/src/mosh/src/terminal/parser.cc 1
/src/mosh/src/terminal/../../src/terminal/parser.h 1
/src/mosh/src/terminal/terminal.cc 2
/src/mosh/src/terminal/terminalframebuffer.cc 9
/usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_vector.h 75
/usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_bvector.h 20
/src/mosh/src/terminal/../../src/terminal/terminalframebuffer.h 37
/usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/shared_ptr.h 11
/usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/shared_ptr_base.h 23
/src/mosh/src/fuzz/../../src/terminal/terminalframebuffer.h 3
/src/mosh/src/terminal/terminaldispatcher.cc 1
/src/mosh/src/terminal/../../src/terminal/terminaluserinput.h 1
/src/mosh/src/fuzz/../../src/terminal/terminaldispatcher.h 1
/usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_list.h 11
/src/mosh/src/fuzz/../../src/terminal/terminal.h 2
/src/mosh/src/fuzz/../../src/terminal/parser.h 2
/src/mosh/src/fuzz/../../src/terminal/parseraction.h 4
/src/mosh/src/statesync/completeterminal.cc 1
/src/mosh/src/terminal/terminaldisplay.cc 9
/src/mosh/src/terminal/./terminaldisplay.h 7
/usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_iterator.h 14
/usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/vector.tcc 2
/usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/list.tcc 1
/usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/ext/aligned_buffer.h 2

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
Terminal::Complete::init_diff[abi:cxx11]()const /src/mosh/src/statesync/completeterminal.cc 2 ['N/A', 'N/A'] 16 0 48 6 6 760 0 1621 277
Parser::Print::act_on_terminal(Terminal::Emulator*)const /src/mosh/src/terminal/parseraction.cc 2 ['N/A', 'N/A'] 13 0 18 3 2 311 0 431 215
Terminal::Complete::apply_string(std::__cxx11::basic_string ,std::allocator >const&) /src/mosh/src/statesync/completeterminal.cc 2 ['N/A', 'N/A'] 12 0 228 55 37 273 0 413 140
CSI_SGR(Terminal::Framebuffer*,Terminal::Dispatcher*) /src/mosh/src/terminal/terminalfunctions.cc 2 ['N/A', 'N/A'] 7 0 211 33 13 71 0 132 117
Parser::OSC_End::act_on_terminal(Terminal::Emulator*)const /src/mosh/src/terminal/parseraction.cc 2 ['N/A', 'N/A'] 12 0 18 3 2 129 0 199 111
HostBuffers::HostMessage::InternalSwap(HostBuffers::HostMessage*) /src/mosh/src/protobufs/hostinput.pb.cc 2 ['N/A', 'N/A'] 9 0 26 3 2 102 0 112 100
Parser::StateFamily::StateFamily() /src/mosh/src/terminal/../../src/terminal/parserstatefamily.h 1 ['N/A'] 2 0 289 58 32 60 0 92 92
Terminal::Complete::compare(Terminal::Completeconst&)const /src/mosh/src/statesync/completeterminal.cc 2 ['N/A', 'N/A'] 7 0 180 26 9 87 0 184 90
Parser::Esc_Dispatch::act_on_terminal(Terminal::Emulator*)const /src/mosh/src/terminal/parseraction.cc 2 ['N/A', 'N/A'] 4 0 18 3 2 47 0 98 76
Parser::Resize::act_on_terminal(Terminal::Emulator*)const /src/mosh/src/terminal/parseraction.cc 2 ['N/A', 'N/A'] 13 0 22 3 2 231 0 386 69

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

Functions statically reachable by fuzzers
40.0%
666 / 1649
Cyclomatic complexity statically reachable by fuzzers
47.0%
2604 / 5596

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

Fuzz engine guidance

This sections provides heuristics that can be used as input to a fuzz engine when running a given fuzz target. The current focus is on providing input that is usable by libFuzzer.

/src/mosh/src/fuzz/terminal_parser_fuzzer.cc

Dictionary

Use this with the libFuzzer -dict=DICT.file flag


Fuzzer function priority

Use one of these functions as input to libfuzzer with flag: -focus_function name

-focus_function=['append_or_delete(std::shared_ptr, std::vector, std::allocator > >&)', 'Parser::State::anywhere_rule(wchar_t) const', 'Parser::State::anywhere_rule(wchar_t) const', 'LLVMFuzzerTestOneInput', 'Parser::Transition::Transition(std::shared_ptr, Parser::State*)', 'Parser::State::anywhere_rule(wchar_t) const', 'Parser::State::anywhere_rule(wchar_t) const', 'Parser::Transition::Transition(Parser::State*, std::shared_ptr)', 'Parser::State::anywhere_rule(wchar_t) const']

/src/mosh/src/fuzz/terminal_fuzzer.cc

Dictionary

Use this with the libFuzzer -dict=DICT.file flag


Fuzzer function priority

Use one of these functions as input to libfuzzer with flag: -focus_function name

-focus_function=['LLVMFuzzerTestOneInput', 'Terminal::Cell::Cell(unsigned int)', 'Terminal::Display::new_frame[abi:cxx11](bool, Terminal::Framebuffer const&, Terminal::Framebuffer const&) const', 'Terminal::Hyperlink::operator!=(Terminal::Hyperlink const&) const', 'Terminal::Display::put_row(bool, Terminal::FrameState&, Terminal::Framebuffer const&, int, Terminal::Row const&, bool) const', 'Terminal::Display::new_frame[abi:cxx11](bool, Terminal::Framebuffer const&, Terminal::Framebuffer const&) const', 'Terminal::FrameState::update_rendition(Terminal::Renditions const&, bool)', 'Terminal::DrawState::DrawState(int, int)', 'Terminal::Framebuffer::Framebuffer(int, int)']

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/mosh/src/statesync/../../src/statesync/completeterminal.h [] []
/usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_vector.h ['terminal_parser_fuzzer', 'terminal_fuzzer'] []
/src/mosh/src/terminal/../../src/terminal/parser.h ['terminal_parser_fuzzer', 'terminal_fuzzer'] []
/usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/atomic [] []
/usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/basic_string.tcc ['terminal_fuzzer'] []
/src/mosh/src/fuzz/../../src/terminal/parseraction.h ['terminal_fuzzer'] []
/usr/include/google/protobuf/message_lite.h [] []
/src/mosh/src/fuzz/terminal_fuzzer.cc ['terminal_fuzzer'] ['terminal_fuzzer']
/usr/include/google/protobuf/repeated_field.h [] []
/usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/shared_ptr.h ['terminal_parser_fuzzer', 'terminal_fuzzer'] []
/usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/basic_string.h ['terminal_fuzzer'] []
/usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_tree.h [] []
/usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_list.h ['terminal_fuzzer'] []
/src/mosh/src/statesync/../../src/terminal/parseraction.h [] []
/usr/include/google/protobuf/stubs/port.h [] []
/src/mosh/src/statesync/../../src/terminal/terminalframebuffer.h [] []
/src/mosh/src/statesync/../../src/protobufs/hostinput.pb.h [] []
/src/mosh/src/fuzz/../../src/terminal/terminal.h ['terminal_fuzzer'] []
/usr/include/google/protobuf/metadata_lite.h [] []
/usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_iterator.h ['terminal_parser_fuzzer', 'terminal_fuzzer'] []
/usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_uninitialized.h [] []
/usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_bvector.h ['terminal_fuzzer'] []
/src/mosh/src/terminal/./terminaldispatcher.h [] []
/src/mosh/src/terminal/./parsertransition.h ['terminal_parser_fuzzer'] []
/src/mosh/src/terminal/../../src/terminal/parseraction.h [] []
/src/mosh/src/terminal/parser.cc ['terminal_parser_fuzzer', 'terminal_fuzzer'] ['terminal_parser_fuzzer', 'terminal_fuzzer']
/usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_algobase.h [] []
/src/mosh/src/terminal/./parserstate.h [] []
/usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/char_traits.h ['terminal_fuzzer'] []
/usr/include/google/protobuf/generated_message_util.h [] []
/src/mosh/src/terminal/terminal.cc ['terminal_fuzzer'] ['terminal_fuzzer']
/src/mosh/src/protobufs/hostinput.pb.cc [] []
/src/mosh/src/fuzz/../../src/terminal/parser.h ['terminal_parser_fuzzer', 'terminal_fuzzer'] []
/usr/include/google/protobuf/stubs/casts.h [] []
/usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/list.tcc ['terminal_fuzzer'] []
/usr/include/google/protobuf/io/coded_stream.h [] []
/src/mosh/src/fuzz/terminal_parser_fuzzer.cc ['terminal_parser_fuzzer'] ['terminal_parser_fuzzer']
/usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/vector.tcc ['terminal_parser_fuzzer', 'terminal_fuzzer'] []
/usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/atomic_base.h [] []
/usr/include/google/protobuf/wire_format_lite.h [] []
/usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/new_allocator.h ['terminal_parser_fuzzer', 'terminal_fuzzer'] []
/src/mosh/src/terminal/terminaldisplay.cc ['terminal_fuzzer'] ['terminal_fuzzer']
/src/mosh/src/terminal/../../src/terminal/terminaluserinput.h ['terminal_fuzzer'] []
/usr/include/google/protobuf/explicitly_constructed.h [] []
/src/mosh/src/fuzz/../../src/terminal/terminaldispatcher.h ['terminal_fuzzer'] []
/usr/include/google/protobuf/has_bits.h [] []
/src/mosh/src/terminal/./terminaldisplay.h ['terminal_fuzzer'] []
/src/mosh/src/terminal/terminalframebuffer.cc ['terminal_fuzzer'] ['terminal_fuzzer']
/src/mosh/src/terminal/terminaluserinput.cc [] []
/src/mosh/src/terminal/terminaldisplayinit.cc ['terminal_fuzzer'] ['terminal_fuzzer']
/usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/allocated_ptr.h [] []
/src/mosh/src/terminal/../../src/terminal/terminalframebuffer.h ['terminal_fuzzer'] []
/usr/include/google/protobuf/repeated_ptr_field.h [] []
/usr/include/google/protobuf/parse_context.h [] []
/usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/tuple [] []
/src/mosh/src/terminal/../../src/terminal/parserstate.h [] []
/src/mosh/src/terminal/../../src/terminal/parsertransition.h ['terminal_parser_fuzzer'] []
/usr/include/google/protobuf/extension_set.h [] []
/src/mosh/src/terminal/../../src/terminal/parserstatefamily.h [] []
/src/mosh/src/protobufs/./hostinput.pb.h [] []
/src/mosh/src/terminal/../../src/terminal/terminaldispatcher.h [] []
/usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/shared_ptr_base.h ['terminal_parser_fuzzer', 'terminal_fuzzer'] []
/usr/include/google/protobuf/arena.h [] []
/src/mosh/src/statesync/../../src/util/fatal_assert.h [] []
/src/mosh/src/statesync/completeterminal.cc ['terminal_fuzzer'] ['terminal_fuzzer']
/src/mosh/src/terminal/terminalfunctions.cc [] []
/usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/ext/aligned_buffer.h ['terminal_fuzzer'] []
/src/mosh/src/fuzz/../../src/statesync/completeterminal.h ['terminal_fuzzer'] []
/usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_construct.h [] []
/usr/include/google/protobuf/arena_impl.h [] []
/src/mosh/src/terminal/parserstate.cc ['terminal_parser_fuzzer'] ['terminal_parser_fuzzer']
/usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_pair.h [] []
/usr/include/google/protobuf/arenastring.h [] []
/src/mosh/src/terminal/parseraction.cc [] []
/src/mosh/src/fuzz/../../src/terminal/terminalframebuffer.h ['terminal_fuzzer'] []
/src/mosh/src/terminal/terminaldispatcher.cc ['terminal_fuzzer'] ['terminal_fuzzer']

Directories in report

Directory
/src/mosh/src/terminal/../../src/terminal/
/src/mosh/src/protobufs/./
/usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/
/src/mosh/src/statesync/
/usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/ext/
/src/mosh/src/fuzz/
/src/mosh/src/statesync/../../src/util/
/src/mosh/src/terminal/./
/src/mosh/src/statesync/../../src/protobufs/
/src/mosh/src/fuzz/../../src/statesync/
/src/mosh/src/statesync/../../src/statesync/
/usr/include/google/protobuf/io/
/src/mosh/src/fuzz/../../src/terminal/
/src/mosh/src/protobufs/
/src/mosh/src/statesync/../../src/terminal/
/src/mosh/src/terminal/
/usr/include/google/protobuf/
/usr/include/google/protobuf/stubs/
/usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/