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_tpm_server

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 1116 77.1%
gold [1:9] 21 1.45%
yellow [10:29] 1 0.06%
greenyellow [30:49] 0 0.0%
lawngreen 50+ 309 21.3%
All colors 1447 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
244 192 CryptRandomGenerate call site: 00192 DRBG_Generate
241 480 TestAlgorithm call site: 00480 TestEcc
220 1084 ParseSessionBuffer call site: 01084 CheckAuthSession
86 1340 CommandDispatcher call site: 01340 BuildResponseSession
42 44 ClearBit call site: 00044 TestSymmetric
36 1044 ExecuteCommand call site: 01044 ObjectLoadEvict
35 123 TestAlgorithm call site: 00123 TestRsa
35 722 CryptHashEnd2B call site: 00722 BnSignEcSchnorr
34 438 CryptHashEnd call site: 00438 CryptMGF1
28 981 _plat__RunCommand call site: 00981 TpmFailureMode
21 1305 CommandAuditIsRequired call site: 01305 CheckCommandAudit
13 1013 TimeUpdateToCurrent call site: 01013 TimeUpdate

Runtime coverage analysis

Covered functions
149
Functions that are reachable but not covered
300
Reachable functions
447
Percentage of reachable functions covered
32.89%
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
fuzzer.cc 1
NVMem.c 12
Manufacture.c 2
CryptUtil.c 7
AlgorithmCap.c 1
Memory.c 11
Bits.c 3
TpmFail.c 5
RunCommand.c 2
CryptSelfTest.c 2
AlgorithmTests.c 17
CryptSym.c 5
CryptHash.c 22
CryptRsa.c 20
CryptRand.c 17
Entropy.c 2
Clock.c 4
MathOnByteBuffers.c 2
BnMemory.c 5
BnConvert.c 6
BnMath.c 17
TpmToOsslMath.c 12
TpmToOsslSupport.c 3
CryptEccMain.c 13
CryptEccSignature.c 10
Cancel.c 1
NVReserved.c 8
NVDynamic.c 24
PCR.c 13
Hierarchy.c 1
DA.c 3
PP.c 2
CommandAudit.c 3
CommandCodeAttributes.c 9
TPMCmdp.c 6
PowerPlat.c 3
StartupCommands.c 1
Power.c 2
Time.c 5
TcpServerPosix.c 3
IntegrityCommands.c 3
Object.c 15
Handle.c 1
LocalityPlat.c 2
ExecCommand.c 1
Unmarshal.c 14
Marshal.c 17
CommandDispatcher.c 2
Entity.c 4
Session.c 9
ResponseCodeProcessing.c 1
SessionProcess.c 34
PPPlat.c 1
Object_spt.c 1
IoBuffers.c 4
Response.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
TPM2_CreateLoaded /src/ibmswtpm2/src/ObjectCommands.c 2 ['N/A', 'N/A'] 48 0 392 52 21 363 0 1716 787
TPM2_GetCapability /src/ibmswtpm2/src/CapabilityCommands.c 2 ['N/A', 'N/A'] 9 0 324 31 2 67 0 297 191
TPM2_Import /src/ibmswtpm2/src/DuplicationCommands.c 2 ['N/A', 'N/A'] 45 0 280 41 17 292 0 1381 174
TPMS_CAPABILITY_DATA_Unmarshal /src/ibmswtpm2/src/Unmarshal.c 3 ['N/A', 'N/A', 'N/A'] 7 0 59 9 4 31 0 166 142
tpm_server_main /src/ibmswtpm2/src/TPMCmds.c 2 ['int', 'N/A'] 55 0 208 37 11 479 0 2164 130
TPM2_Quote /src/ibmswtpm2/src/AttestationCommands.c 2 ['N/A', 'N/A'] 44 0 99 10 5 223 0 1001 120
TPM2_Startup /src/ibmswtpm2/src/StartupCommands.c 1 ['N/A'] 47 0 287 46 15 235 0 1093 103
TPMS_ATTEST_Unmarshal /src/ibmswtpm2/src/Unmarshal.c 3 ['N/A', 'N/A', 'N/A'] 7 0 150 24 9 28 0 127 85
TPM2_PolicySigned /src/ibmswtpm2/src/EACommands.c 2 ['N/A', 'N/A'] 45 0 229 22 9 216 0 996 79
TPMS_CAPABILITY_DATA_Marshal /src/ibmswtpm2/src/Marshal.c 3 ['N/A', 'N/A', 'N/A'] 10 0 45 3 2 34 0 112 73

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

Functions statically reachable by fuzzers
68.0%
765 / 1125
Cyclomatic complexity statically reachable by fuzzers
67.0%
3796 / 5637

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/ibmswtpm2/src/ClockCommands.c [] []
/src/ibmswtpm2/src/Unique.c [] []
/src/ibmswtpm2/src/StartupCommands.c ['fuzz_tpm_server'] ['fuzz_tpm_server']
/src/ibmswtpm2/src/TpmSizeChecks.c [] []
/src/ibmswtpm2/src/CryptRand.c ['fuzz_tpm_server'] ['fuzz_tpm_server']
/src/ibmswtpm2/src/ObjectCommands.c [] []
/src/ibmswtpm2/src/Policy_spt.c [] []
/src/ibmswtpm2/src/CryptPrime.c [] []
/src/ibmswtpm2/src/AlgorithmTests.c ['fuzz_tpm_server'] ['fuzz_tpm_server']
/src/ibmswtpm2/src/BnMath.c ['fuzz_tpm_server'] []
/src/ibmswtpm2/src/CryptSelfTest.c ['fuzz_tpm_server'] ['fuzz_tpm_server']
/src/ibmswtpm2/src/ResponseCodeProcessing.c ['fuzz_tpm_server'] []
/src/ibmswtpm2/src/TestingCommands.c [] []
/src/ibmswtpm2/src/Object_spt.c ['fuzz_tpm_server'] []
/src/ibmswtpm2/src/TPMCmdp.c ['fuzz_tpm_server'] ['fuzz_tpm_server']
/src/ibmswtpm2/src/CryptRsa.c ['fuzz_tpm_server'] ['fuzz_tpm_server']
/src/ibmswtpm2/src/BnConvert.c ['fuzz_tpm_server'] []
/src/ibmswtpm2/src/PCR.c ['fuzz_tpm_server'] ['fuzz_tpm_server']
/src/ibmswtpm2/src/Response.c ['fuzz_tpm_server'] ['fuzz_tpm_server']
/src/ibmswtpm2/src/RandomCommands.c [] []
/src/ibmswtpm2/src/Cancel.c ['fuzz_tpm_server'] []
/src/ibmswtpm2/src/NVCommands.c [] []
/src/ibmswtpm2/src/AuditCommands.c [] []
/src/ibmswtpm2/src/Entropy.c ['fuzz_tpm_server'] ['fuzz_tpm_server']
/src/ibmswtpm2/src/Manufacture.c ['fuzz_tpm_server'] ['fuzz_tpm_server']
/src/ibmswtpm2/src/CryptUtil.c ['fuzz_tpm_server'] ['fuzz_tpm_server']
/src/ibmswtpm2/src/NV_spt.c [] []
/src/ibmswtpm2/src/TpmToOsslMath.c ['fuzz_tpm_server'] []
/src/ibmswtpm2/src/AsymmetricCommands.c [] []
/src/ibmswtpm2/src/Ticket.c [] []
/src/ibmswtpm2/src/DictionaryCommands.c [] []
/src/ibmswtpm2/src/NVMem.c ['fuzz_tpm_server'] ['fuzz_tpm_server']
/src/ibmswtpm2/src/NVReserved.c ['fuzz_tpm_server'] ['fuzz_tpm_server']
/src/ibmswtpm2/src/Entity.c ['fuzz_tpm_server'] ['fuzz_tpm_server']
/src/ibmswtpm2/src/CryptHash.c ['fuzz_tpm_server'] ['fuzz_tpm_server']
/src/ibmswtpm2/src/CommandDispatcher.c ['fuzz_tpm_server'] ['fuzz_tpm_server']
/src/ibmswtpm2/src/ntc2lib.c [] []
/src/ibmswtpm2/src/HashCommands.c [] []
/src/ibmswtpm2/src/Memory.c ['fuzz_tpm_server'] ['fuzz_tpm_server']
/src/ibmswtpm2/src/Context_spt.c [] []
/src/ibmswtpm2/src/CryptEccMain.c ['fuzz_tpm_server'] ['fuzz_tpm_server']
/src/ibmswtpm2/src/CryptEccKeyExchange.c [] []
/src/ibmswtpm2/src/PP.c ['fuzz_tpm_server'] ['fuzz_tpm_server']
/src/ibmswtpm2/src/RunCommand.c ['fuzz_tpm_server'] ['fuzz_tpm_server']
/src/ibmswtpm2/src/CommandAudit.c ['fuzz_tpm_server'] ['fuzz_tpm_server']
/src/ibmswtpm2/src/AlgorithmCap.c ['fuzz_tpm_server'] ['fuzz_tpm_server']
/src/ibmswtpm2/src/DuplicationCommands.c [] []
/src/ibmswtpm2/src/TcpServerPosix.c ['fuzz_tpm_server'] ['fuzz_tpm_server']
/src/ibmswtpm2/src/ExecCommand.c ['fuzz_tpm_server'] ['fuzz_tpm_server']
/src/ibmswtpm2/src/NVDynamic.c ['fuzz_tpm_server'] ['fuzz_tpm_server']
/src/ibmswtpm2/src/ManagementCommands.c [] []
/src/ibmswtpm2/src/HierarchyCommands.c [] []
/src/ibmswtpm2/src/CryptEccSignature.c ['fuzz_tpm_server'] []
/src/ibmswtpm2/src/Locality.c [] []
/src/ibmswtpm2/src/BnMemory.c ['fuzz_tpm_server'] []
/src/ibmswtpm2/src/Object.c ['fuzz_tpm_server'] ['fuzz_tpm_server']
/src/ibmswtpm2/src/PropertyCap.c [] []
/src/ibmswtpm2/src/SessionCommands.c [] []
/src/ibmswtpm2/src/Unmarshal.c ['fuzz_tpm_server'] ['fuzz_tpm_server']
/src/ibmswtpm2/src/ContextCommands.c [] []
/src/ibmswtpm2/src/Handle.c ['fuzz_tpm_server'] ['fuzz_tpm_server']
/src/ibmswtpm2/src/CryptPrimeSieve.c [] []
/src/ibmswtpm2/src/MathOnByteBuffers.c ['fuzz_tpm_server'] []
/src/ibmswtpm2/src/Vendor_TCG_Test.c [] []
/src/ibmswtpm2/src/EphemeralCommands.c [] []
/src/ibmswtpm2/src/Attest_spt.c [] []
/src/ibmswtpm2/src/LocalityPlat.c ['fuzz_tpm_server'] ['fuzz_tpm_server']
/src/ibmswtpm2/src/TpmToOsslSupport.c ['fuzz_tpm_server'] ['fuzz_tpm_server']
/src/ibmswtpm2/src/Power.c ['fuzz_tpm_server'] ['fuzz_tpm_server']
/src/ibmswtpm2/src/Time.c ['fuzz_tpm_server'] ['fuzz_tpm_server']
/src/ibmswtpm2/src/Marshal.c ['fuzz_tpm_server'] ['fuzz_tpm_server']
/src/ibmswtpm2/src/fuzzer.cc ['fuzz_tpm_server'] ['fuzz_tpm_server']
/src/ibmswtpm2/src/IntegrityCommands.c ['fuzz_tpm_server'] ['fuzz_tpm_server']
/src/ibmswtpm2/src/PPPlat.c ['fuzz_tpm_server'] []
/src/ibmswtpm2/src/EACommands.c [] []
/src/ibmswtpm2/src/SessionProcess.c ['fuzz_tpm_server'] ['fuzz_tpm_server']
/src/ibmswtpm2/src/TPMCmds.c [] []
/src/ibmswtpm2/src/CommandCodeAttributes.c ['fuzz_tpm_server'] ['fuzz_tpm_server']
/src/ibmswtpm2/src/SymmetricCommands.c [] []
/src/ibmswtpm2/src/AttestationCommands.c [] []
/src/ibmswtpm2/src/ntc2.c [] []
/src/ibmswtpm2/src/Session.c ['fuzz_tpm_server'] []
/src/ibmswtpm2/src/IoBuffers.c ['fuzz_tpm_server'] ['fuzz_tpm_server']
/src/ibmswtpm2/src/TpmFail.c ['fuzz_tpm_server'] []
/src/ibmswtpm2/src/SigningCommands.c [] []
/src/ibmswtpm2/src/CryptSym.c ['fuzz_tpm_server'] ['fuzz_tpm_server']
/src/ibmswtpm2/src/Clock.c ['fuzz_tpm_server'] ['fuzz_tpm_server']
/src/ibmswtpm2/src/PowerPlat.c ['fuzz_tpm_server'] ['fuzz_tpm_server']
/src/ibmswtpm2/src/Hierarchy.c ['fuzz_tpm_server'] ['fuzz_tpm_server']
/src/ibmswtpm2/src/EncryptDecrypt_spt.c [] []
/src/ibmswtpm2/src/DA.c ['fuzz_tpm_server'] ['fuzz_tpm_server']
/src/ibmswtpm2/src/Bits.c ['fuzz_tpm_server'] ['fuzz_tpm_server']
/src/ibmswtpm2/src/CapabilityCommands.c [] []
/src/ibmswtpm2/src/CryptSmac.c [] []
/src/ibmswtpm2/src/CryptCmac.c [] []

Directories in report

Directory
/src/ibmswtpm2/src/