The fuzzer plugin for libmedia_codecserviceregistrant is designed based on the understanding of the library and tries to achieve the following:
The configuration parameters are not hardcoded, but instead selected based on incoming data. This ensures more code paths are reached by the fuzzer.
libmedia_codecserviceregistrant supports the following parameters:
c2String
)width
)height
)samplingRate
)channels
)stream
)Parameter | Valid Values | Configured Value |
---|---|---|
c2String | String | Value obtained from FuzzedDataProvider |
width | UINT32_MIN to UINT32_MAX | Value obtained from FuzzedDataProvider |
height | UINT32_MIN to UINT32_MAX | Value obtained from FuzzedDataProvider |
samplingRate | UINT32_MIN to UINT32_MAX | Value obtained from FuzzedDataProvider |
channels | UINT32_MIN to UINT32_MAX | Value obtained from FuzzedDataProvider |
stream | UINT32_MIN to UINT32_MAX | Value obtained from FuzzedDataProvider |
This also ensures that the plugin is always deterministic for any given input.
The plugin feeds the entire input data to the libmedia_codecserviceregistrant module. This ensures that the plugin tolerates any kind of input (empty, huge, malformed, etc) and doesnt exit()
on any input and thereby increasing the chance of identifying vulnerabilities.
This describes steps to build codecServiceRegistrant_fuzzer binary.
Build the fuzzer
$ mm -j$(nproc) codecServiceRegistrant_fuzzer
To run on device
$ adb sync data $ adb shell /data/fuzz/${TARGET_ARCH}/codecServiceRegistrant_fuzzer/codecServiceRegistrant_fuzzer