tree: 2b9f6fb2e54fec38b05bbc51cc913117d5d521aa [path history] [tgz]
  1. Android.bp
  2. btcore_device_class_fuzzer.cpp
  3. btcore_module_fuzzer.cpp
  4. btcore_property_fuzzer.cpp
  5. README.md
btcore/fuzzer/README.md

Fuzzers for libbtcore

Plugin Design Considerations

The fuzzer plugins for libbtcore are designed based on the understanding of the source code and tries to achieve the following:

Maximize code coverage

The configuration parameters are not hard-coded, but instead selected based on incoming data. This ensures more code paths are reached by the fuzzers.

Fuzzers assigns values to the following parameters to pass on to libbtcore:

  1. Bluetooth Device Type (parameter name: deviceType)
  2. Bluetooth Adapter Visibility Mode (parameter name: mode)
  3. Bluetooth Address (parameter name: btAddress)
  4. Bluetooth Device Class parameter (parameter name: deviceClassT)
ParameterValid ValuesConfigured Value
deviceType0.BT_DEVICE_DEVTYPE_BREDR 1.BT_DEVICE_DEVTYPE_BLE 2.BT_DEVICE_DEVTYPE_DUALValue obtained from FuzzedDataProvider
mode0.BT_SCAN_MODE_NONE 1.BT_SCAN_MODE_CONNECTABLE 2.BT_SCAN_MODE_CONNECTABLE_DISCOVERABLEValue obtained from FuzzedDataProvider
btAddressValues inside array ranges from 0x0 to 0xFFValue obtained from FuzzedDataProvider
deviceClassTValues inside array ranges from 0x0 to 0xFFValue obtained from FuzzedDataProvider
This also ensures that the plugins are always deterministic for any given input.
Maximize utilization of input data

The plugins feed the entire input data to the module. This ensures that the plugins tolerates any kind of input (empty, huge, malformed, etc) and doesn't exit() on any input and thereby increasing the chance of identifying vulnerabilities.

Build

This describes steps to build btcore_device_class_fuzzer, btcore_property_fuzzer and btcore_module_fuzzer binaries.

Android

Steps to build

Build the fuzzer

  $ mm -j$(nproc) btcore_device_class_fuzzer
  $ mm -j$(nproc) btcore_property_fuzzer
  $ mm -j$(nproc) btcore_module_fuzzer

Steps to run

To run on device

  $ adb sync data
  $ adb shell /data/fuzz/arm64/btcore_device_class_fuzzer/btcore_device_class_fuzzer
  $ adb shell /data/fuzz/arm64/btcore_property_fuzzer/btcore_property_fuzzer
  $ adb shell /data/fuzz/arm64/btcore_module_fuzzer/btcore_module_fuzzer

References: