The fuzzer plugin 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.
libcameraservice supports the following parameters:
cameraType
)cameraAPIVersion
)eventId
)soundKind
)shellCommand
)Parameter | Valid Values | Configured Value |
---|---|---|
cameraType | 0. CAMERA_TYPE_BACKWARD_COMPATIBLE 1. CAMERA_TYPE_ALL | Value obtained from FuzzedDataProvider |
cameraAPIVersion | 0. API_VERSION_1 1. API_VERSION_2 | Value obtained from FuzzedDataProvider |
eventId | 0. EVENT_USER_SWITCHED 1. EVENT_NONE | Value obtained from FuzzedDataProvider |
soundKind | 0. SOUND_SHUTTER 1. SOUND_RECORDING_START 2. SOUND_RECORDING_STOP | Value obtained from FuzzedDataProvider |
shellCommand | 0. set-uid-state 1. reset-uid-state 2. get-uid-state 3. set-rotate-and-crop 4. get-rotate-and-crop 5. help | Value obtained from FuzzedDataProvider |
This also ensures that the plugin is always deterministic for any given input.
The plugin tolerates any kind of input (empty, huge, malformed, etc) and doesn't exit()
on any input and thereby increasing the chance of identifying vulnerabilities.
This describes steps to build camera_service_fuzzer binary.
Build the fuzzer
$ mm -j$(nproc) camera_service_fuzzer
Create a directory CORPUS_DIR
$ adb shell mkdir CORPUS_DIR
To run on device
$ adb sync data $ adb shell /data/fuzz/arm64/camera_service_fuzzer/camera_service_fuzzer CORPUS_DIR