mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-02 17:31:58 +00:00
Added fuzz_config and its fields like - cc, componentid, hotlists, description, vector, service_privilege, users & fuzzed_code_usage. Bug: 306435930 Test: Build the updated fuzz targets Change-Id: Ib537f4c4c98860de431e33dedbd106930cf8e45a
Fuzzers for libkeymint_support
Plugin Design Considerations
The fuzzer plugins for libkeymint_support are designed based on the understanding of the source code and try to achieve the following:
Maximize code coverage
The configuration parameters are not hardcoded, but instead selected based on incoming data. This ensures more code paths are reached by the fuzzers.
Maximize utilization of input data
The plugins feed the entire input data to the module. This ensures that the plugins tolerate any kind of input (empty, huge, malformed, etc) and dont exit() on any input and thereby increasing the chance of identifying vulnerabilities.
Table of contents
- keymint_attestation_fuzzer
- keymint_authSet_fuzzer
- keymint_remote_prov_fuzzer
- keymint_rkpsupport_fuzzer
Fuzzer for KeyMintAttestation
KeyMintAttestation supports the following parameters:
- PaddingMode(parameter name: "padding")
- Digest(parameter name: "digest")
- Index(parameter name: "idx")
- Timestamp(parameter name: "timestamp")
- AuthSet(parameter name: "authSet")
- IssuerSubjectName(parameter name: "issuerSubjectName")
- AttestationChallenge(parameter name: "challenge")
- AttestationApplicationId(parameter name: "id")
- EcCurve(parameter name: "ecCurve")
- BlockMode(parameter name: "blockmode")
- minMacLength(parameter name: "minMacLength")
- macLength(parameter name: "macLength")
| Parameter | Valid Values | Configured Value |
|---|---|---|
padding |
PaddingMode |
Value obtained from FuzzedDataProvider |
digest |
Digest |
Value obtained from FuzzedDataProvider |
idx |
size_t |
Value obtained from FuzzedDataProvider |
timestamp |
uint64_t |
Value obtained from FuzzedDataProvider |
authSet |
uint32_t |
Value obtained from FuzzedDataProvider |
issuerSubjectName |
uint8_t |
Value obtained from FuzzedDataProvider |
AttestationChallenge |
string |
Value obtained from FuzzedDataProvider |
AttestationApplicationId |
string |
Value obtained from FuzzedDataProvider |
blockmode |
BlockMode |
Value obtained from FuzzedDataProvider |
minMacLength |
uint32_t |
Value obtained from FuzzedDataProvider |
macLength |
uint32_t |
Value obtained from FuzzedDataProvider |
Steps to run
- Build the fuzzer
$ mm -j$(nproc) keymint_attestation_fuzzer
- Run on device
$ adb sync data
$ adb shell /data/fuzz/arm64/keymint_attestation_fuzzer/keymint_attestation_fuzzer
Fuzzer for KeyMintAuthSet
KeyMintAuthSet supports the following parameters:
- AuthorizationSet(parameter name: "authSet")
- AuthorizationSet(parameter name: "params")
- KeyParameters(parameter name: "numKeyParam")
- Tag(parameter name: "tag")
| Parameter | Valid Values | Configured Value |
|---|---|---|
authSet |
AuthorizationSet |
Value obtained from FuzzedDataProvider |
params |
AuthorizationSet |
Value obtained from FuzzedDataProvider |
numKeyParam |
size_t |
Value obtained from FuzzedDataProvider |
tag |
Tag |
Value obtained from FuzzedDataProvider |
Steps to run
- Build the fuzzer
$ mm -j$(nproc) keymint_authSet_fuzzer
- Run on device
$ adb sync data
$ adb shell /data/fuzz/arm64/keymint_authSet_fuzzer/keymint_authSet_fuzzer
Fuzzer for KeyMintRemoteProv
KeyMintRemoteProv supports the following parameters:
- ChallengeSize(parameter name: "challengeSize")
- Challenge(parameter name: "challenge")
- NumKeys(parameter name: "numKeys")
| Parameter | Valid Values | Configured Value |
|---|---|---|
challengeSize |
uint8_t |
Value obtained from FuzzedDataProvider |
challenge |
std::vector<uint8_t> |
Value obtained from FuzzedDataProvider |
numKeys |
uint8_t |
Value obtained from FuzzedDataProvider |
Steps to run
- Build the fuzzer
$ mm -j$(nproc) keymint_remote_prov_fuzzer
- Run on device
$ adb sync data
$ adb shell /data/fuzz/arm64/keymint_remote_prov_fuzzer/keymint_remote_prov_fuzzer
Fuzzer for KeyMintRemoteKeyProvSupport
KeyMintRemoteKeyProvSupport supports the following parameters:
- SupportedEekCurve(parameter name: "supportedEekCurve")
- Length(parameter name: "length")
- SerialNumberProp(parameter name: "serialNoProp")
- InstanceName(parameter name: "instanceName")
- Value(parameter name: "value")
| Parameter | Valid Values | Configured Value |
|---|---|---|
supportedEekCurve |
uint8_t |
Value obtained from FuzzedDataProvider |
length |
uint8_t |
Value obtained from FuzzedDataProvider |
serialNoProp |
string |
Value obtained from FuzzedDataProvider |
instanceName |
string |
Value obtained from FuzzedDataProvider |
value |
uint8_t |
Value obtained from FuzzedDataProvider |
Steps to run
- Build the fuzzer
$ mm -j$(nproc) keymint_rkpsupport_fuzzer
- Run on device
$ adb sync data
$ adb shell /data/fuzz/arm64/keymint_rkpsupport_fuzzer/keymint_rkpsupport_fuzzer