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

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 1058 76.3%
gold [1:9] 21 1.51%
yellow [10:29] 1 0.07%
greenyellow [30:49] 0 0.0%
lawngreen 50+ 306 22.0%
All colors 1386 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
1684 1686 2 :

['CryptKDFa', 'MemoryCopy']

1684 1686 DRBG_Generate call site: 00141 /src/ibmswtpm2/src/CryptRand.c:671
1055 1055 1 :

['BuildResponseSession']

1067 1146 ExecuteCommand call site: 01274 /src/ibmswtpm2/src/ExecCommand.c:271
1035 1035 1 :

['TpmFailureMode']

1035 1035 ExecuteCommand call site: 00953 /src/ibmswtpm2/src/ExecCommand.c:123
924 924 1 :

['CheckCommandAudit']

924 924 CheckAuthNoSession call site: 01271 /src/ibmswtpm2/src/SessionProcess.c:1553
828 828 1 :

['CryptHashBlock']

828 1669 CryptHmacStart call site: 00095 /src/ibmswtpm2/src/CryptHash.c:573
42 42 1 :

['PCRResetDynamics']

42 953 _TPM_Hash_End call site: 00913 /src/ibmswtpm2/src/IntegrityCommands.c:376
42 42 3 :

['DfUpdate', 'DfEnd', 'DfStart']

42 42 DfBuffer call site: 00758 /src/ibmswtpm2/src/CryptRand.c:203
6 6 1 :

['TpmFail']

6 6 TestHash call site: 00109 /src/ibmswtpm2/src/AlgorithmTests.c:151
6 6 1 :

['TpmFail']

6 6 DRBG_Update call site: 00170 /src/ibmswtpm2/src/CryptRand.c:366
6 6 1 :

['TpmFail']

6 6 DRBG_Generate call site: 00177 /src/ibmswtpm2/src/CryptRand.c:761
6 6 1 :

['TpmFail']

6 6 UINT16_Marshal call site: 01072 /src/ibmswtpm2/src/Marshal.c:99
6 6 1 :

['TpmFail']

6 6 UINT32_Marshal call site: 01069 /src/ibmswtpm2/src/Marshal.c:120

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 1
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
CommandDispatcher.c 2
Entity.c 4
Session.c 8
ResponseCodeProcessing.c 1
SessionProcess.c 34
Marshal.c 17
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 404 52 21 363 0 1716 787
TPM2_GetCapability /src/ibmswtpm2/src/CapabilityCommands.c 2 ['N/A', 'N/A'] 9 0 327 31 2 67 0 297 191
TPM2_Import /src/ibmswtpm2/src/DuplicationCommands.c 2 ['N/A', 'N/A'] 45 0 289 41 17 292 0 1381 174
TPMS_CAPABILITY_DATA_Unmarshal /src/ibmswtpm2/src/Unmarshal.c 3 ['N/A', 'N/A', 'N/A'] 7 0 63 9 4 31 0 166 142
tpm_server_main /src/ibmswtpm2/src/TPMCmds.c 2 ['int', 'N/A'] 55 0 215 37 11 479 0 2164 130
TPM2_Quote /src/ibmswtpm2/src/AttestationCommands.c 2 ['N/A', 'N/A'] 44 0 104 10 5 223 0 1001 120
TPM2_Startup /src/ibmswtpm2/src/StartupCommands.c 1 ['N/A'] 47 0 290 46 15 235 0 1093 103
TPMS_ATTEST_Unmarshal /src/ibmswtpm2/src/Unmarshal.c 3 ['N/A', 'N/A', 'N/A'] 7 0 154 24 9 28 0 127 85
TPM2_PolicySigned /src/ibmswtpm2/src/EACommands.c 2 ['N/A', 'N/A'] 45 0 238 22 9 216 0 996 79
TPMS_CAPABILITY_DATA_Marshal /src/ibmswtpm2/src/Marshal.c 3 ['N/A', 'N/A', 'N/A'] 10 0 49 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 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/Unmarshal.c ['fuzz_tpm_server'] ['fuzz_tpm_server']
/src/ibmswtpm2/src/Response.c ['fuzz_tpm_server'] ['fuzz_tpm_server']
/src/ibmswtpm2/src/NVCommands.c [] []
/src/ibmswtpm2/src/TpmFail.c ['fuzz_tpm_server'] []
/src/ibmswtpm2/src/TPMCmds.c [] []
/src/ibmswtpm2/src/ntc2lib.c [] []
/src/ibmswtpm2/src/BnMemory.c ['fuzz_tpm_server'] []
/src/ibmswtpm2/src/IntegrityCommands.c ['fuzz_tpm_server'] ['fuzz_tpm_server']
/src/ibmswtpm2/src/TestingCommands.c [] []
/src/ibmswtpm2/src/CapabilityCommands.c [] []
/src/ibmswtpm2/src/LocalityPlat.c ['fuzz_tpm_server'] ['fuzz_tpm_server']
/src/ibmswtpm2/src/PP.c ['fuzz_tpm_server'] ['fuzz_tpm_server']
/src/ibmswtpm2/src/CryptPrimeSieve.c [] []
/src/ibmswtpm2/src/Marshal.c ['fuzz_tpm_server'] ['fuzz_tpm_server']
/src/ibmswtpm2/src/CryptEccKeyExchange.c [] []
/src/ibmswtpm2/src/Bits.c ['fuzz_tpm_server'] ['fuzz_tpm_server']
/src/ibmswtpm2/src/Power.c ['fuzz_tpm_server'] ['fuzz_tpm_server']
/src/ibmswtpm2/src/TpmToOsslMath.c ['fuzz_tpm_server'] []
/src/ibmswtpm2/src/Locality.c [] []
/src/ibmswtpm2/src/PropertyCap.c [] []
/src/ibmswtpm2/src/CommandDispatcher.c ['fuzz_tpm_server'] ['fuzz_tpm_server']
/src/ibmswtpm2/src/HashCommands.c [] []
/src/ibmswtpm2/src/Vendor_TCG_Test.c [] []
/src/ibmswtpm2/src/TpmSizeChecks.c [] []
/src/ibmswtpm2/src/AuditCommands.c [] []
/src/ibmswtpm2/src/ManagementCommands.c [] []
/src/ibmswtpm2/src/NVMem.c ['fuzz_tpm_server'] ['fuzz_tpm_server']
/src/ibmswtpm2/src/DA.c ['fuzz_tpm_server'] ['fuzz_tpm_server']
/src/ibmswtpm2/src/EncryptDecrypt_spt.c [] []
/src/ibmswtpm2/src/Time.c ['fuzz_tpm_server'] ['fuzz_tpm_server']
/src/ibmswtpm2/src/HierarchyCommands.c [] []
/src/ibmswtpm2/src/MathOnByteBuffers.c ['fuzz_tpm_server'] []
/src/ibmswtpm2/src/PCR.c ['fuzz_tpm_server'] ['fuzz_tpm_server']
/src/ibmswtpm2/src/BnConvert.c ['fuzz_tpm_server'] []
/src/ibmswtpm2/src/Unique.c [] []
/src/ibmswtpm2/src/CryptCmac.c [] []
/src/ibmswtpm2/src/Hierarchy.c ['fuzz_tpm_server'] ['fuzz_tpm_server']
/src/ibmswtpm2/src/AlgorithmCap.c ['fuzz_tpm_server'] ['fuzz_tpm_server']
/src/ibmswtpm2/src/AsymmetricCommands.c [] []
/src/ibmswtpm2/src/CryptEccSignature.c ['fuzz_tpm_server'] []
/src/ibmswtpm2/src/RunCommand.c ['fuzz_tpm_server'] ['fuzz_tpm_server']
/src/ibmswtpm2/src/ObjectCommands.c [] []
/src/ibmswtpm2/src/CryptSym.c ['fuzz_tpm_server'] ['fuzz_tpm_server']
/src/ibmswtpm2/src/Policy_spt.c [] []
/src/ibmswtpm2/src/StartupCommands.c ['fuzz_tpm_server'] ['fuzz_tpm_server']
/src/ibmswtpm2/src/Manufacture.c ['fuzz_tpm_server'] ['fuzz_tpm_server']
/src/ibmswtpm2/src/SessionProcess.c ['fuzz_tpm_server'] ['fuzz_tpm_server']
/src/ibmswtpm2/src/Cancel.c ['fuzz_tpm_server'] []
/src/ibmswtpm2/src/ClockCommands.c [] []
/src/ibmswtpm2/src/ResponseCodeProcessing.c ['fuzz_tpm_server'] []
/src/ibmswtpm2/src/NVReserved.c ['fuzz_tpm_server'] ['fuzz_tpm_server']
/src/ibmswtpm2/src/TPMCmdp.c ['fuzz_tpm_server'] ['fuzz_tpm_server']
/src/ibmswtpm2/src/SessionCommands.c [] []
/src/ibmswtpm2/src/DictionaryCommands.c [] []
/src/ibmswtpm2/src/PowerPlat.c ['fuzz_tpm_server'] ['fuzz_tpm_server']
/src/ibmswtpm2/src/CryptSmac.c [] []
/src/ibmswtpm2/src/NV_spt.c [] []
/src/ibmswtpm2/src/CommandCodeAttributes.c ['fuzz_tpm_server'] ['fuzz_tpm_server']
/src/ibmswtpm2/src/Memory.c ['fuzz_tpm_server'] ['fuzz_tpm_server']
/src/ibmswtpm2/src/CryptEccMain.c ['fuzz_tpm_server'] ['fuzz_tpm_server']
/src/ibmswtpm2/src/DuplicationCommands.c [] []
/src/ibmswtpm2/src/Entity.c ['fuzz_tpm_server'] ['fuzz_tpm_server']
/src/ibmswtpm2/src/TpmToOsslSupport.c ['fuzz_tpm_server'] ['fuzz_tpm_server']
/src/ibmswtpm2/src/CryptUtil.c ['fuzz_tpm_server'] ['fuzz_tpm_server']
/src/ibmswtpm2/src/CryptRand.c ['fuzz_tpm_server'] ['fuzz_tpm_server']
/src/ibmswtpm2/src/CryptPrime.c [] []
/src/ibmswtpm2/src/ExecCommand.c ['fuzz_tpm_server'] ['fuzz_tpm_server']
/src/ibmswtpm2/src/Handle.c ['fuzz_tpm_server'] ['fuzz_tpm_server']
/src/ibmswtpm2/src/BnMath.c ['fuzz_tpm_server'] []
/src/ibmswtpm2/src/Context_spt.c [] []
/src/ibmswtpm2/src/PPPlat.c ['fuzz_tpm_server'] []
/src/ibmswtpm2/src/ntc2.c [] []
/src/ibmswtpm2/src/Clock.c ['fuzz_tpm_server'] ['fuzz_tpm_server']
/src/ibmswtpm2/src/CryptSelfTest.c ['fuzz_tpm_server'] ['fuzz_tpm_server']
/src/ibmswtpm2/src/RandomCommands.c [] []
/src/ibmswtpm2/src/EphemeralCommands.c [] []
/src/ibmswtpm2/src/Session.c ['fuzz_tpm_server'] []
/src/ibmswtpm2/src/AttestationCommands.c [] []
/src/ibmswtpm2/src/IoBuffers.c ['fuzz_tpm_server'] ['fuzz_tpm_server']
/src/ibmswtpm2/src/Object.c ['fuzz_tpm_server'] ['fuzz_tpm_server']
/src/ibmswtpm2/src/Entropy.c ['fuzz_tpm_server'] ['fuzz_tpm_server']
/src/ibmswtpm2/src/ContextCommands.c [] []
/src/ibmswtpm2/src/SymmetricCommands.c [] []
/src/ibmswtpm2/src/Object_spt.c ['fuzz_tpm_server'] []
/src/ibmswtpm2/src/Attest_spt.c [] []
/src/ibmswtpm2/src/CryptHash.c ['fuzz_tpm_server'] ['fuzz_tpm_server']
/src/ibmswtpm2/src/TcpServerPosix.c ['fuzz_tpm_server'] ['fuzz_tpm_server']
/src/ibmswtpm2/src/fuzzer.cc ['fuzz_tpm_server'] ['fuzz_tpm_server']
/src/ibmswtpm2/src/SigningCommands.c [] []
/src/ibmswtpm2/src/AlgorithmTests.c ['fuzz_tpm_server'] ['fuzz_tpm_server']
/src/ibmswtpm2/src/CryptRsa.c ['fuzz_tpm_server'] ['fuzz_tpm_server']
/src/ibmswtpm2/src/EACommands.c [] []
/src/ibmswtpm2/src/CommandAudit.c ['fuzz_tpm_server'] ['fuzz_tpm_server']
/src/ibmswtpm2/src/NVDynamic.c ['fuzz_tpm_server'] ['fuzz_tpm_server']
/src/ibmswtpm2/src/Ticket.c [] []

Directories in report

Directory
/src/ibmswtpm2/src/