[Paper Review] DICE: Automatic Emulation of DMA Input Channels for Dynamic Firmware Analysis
DICE is a hardware-independent, analyzer-agnostic framework that automatically identifies and emulates DMA input channels in embedded firmware during dynamic analysis, enabling full code coverage and vulnerability detection without source code or hardware. It achieves 89% true positive detection of DMA channels and increases code path coverage by up to 79X in real-world firmware, uncovering 5 new previously unknown bugs.
Microcontroller-based embedded devices are at the core of Internet-of-Things and Cyber-Physical Systems. The security of these devices is of paramount importance. Among the approaches to securing embedded devices, dynamic firmware analysis gained great attention lately, thanks to its offline nature and low false-positive rates. However, regardless of the analysis and emulation techniques used, existing dynamic firmware analyzers share a major limitation, namely the inability to handle firmware using DMA. It severely limits the types of devices supported and firmware code coverage. We present DICE, a drop-in solution for firmware analyzers to emulate DMA input channels and generate or manipulate DMA inputs. DICE is designed to be hardware-independent, and compatible with common MCU firmware and embedded architectures. DICE identifies DMA input channels as the firmware writes the source and destination DMA transfer pointers into the DMA controller. Then DICE manipulates the input transferred through DMA on behalf of the firmware analyzer. We integrated DICE to the firmware analyzer P2IM (Cortex-M architecture) and a PIC32 emulator (MIPS M4K/M-Class architecture). We evaluated it on 83 benchmarks and sample firmware, representing 9 different DMA controllers from 5 different vendors. DICE detected 33 out of 37 DMA input channels, with 0 false positives. It correctly supplied DMA inputs to 21 out of 22 DMA buffers, which previous firmware analyzers cannot achieve due to the lack of DMA emulation. DICE's overhead is fairly low, it adds 3.4% on average to P2IM execution time. We also fuzz-tested 7 real-world firmware using DICE and compared the results with the original P2IM. DICE uncovered tremendously more execution paths (as much as 79X) and found 5 unique previously-unknown bugs that are unreachable without DMA emulation. All our source code and dataset are publicly available.
Motivation & Objective
- To address the critical limitation in dynamic firmware analysis where existing tools fail to handle DMA-based input channels.
- To enable full code coverage and vulnerability detection in DMA-enabled MCU firmware without requiring firmware source code or hardware dependencies.
- To design a generic, hardware-agnostic solution compatible with diverse embedded architectures and DMA controllers.
- To integrate seamlessly with existing firmware analyzers as a drop-in module for automatic DMA input emulation.
- To detect and supply valid DMA inputs dynamically during emulation, ensuring firmware execution proceeds correctly.
Proposed method
- DICE identifies DMA input channels by monitoring firmware writes to DMA controller registers, specifically the source and destination transfer pointers.
- It dynamically infers the memory buffer locations and sizes used for DMA transfers by analyzing these register writes during emulation.
- The framework emulates DMA input data on behalf of the firmware analyzer, supplying valid data to memory buffers as if written by real peripherals.
- DICE operates without modifying firmware or requiring source code, making it compatible with any firmware analyzer and embedded architecture.
- It integrates with existing emulators like P 2 IM and a MIPS PIC32 emulator to provide transparent DMA input support.
- The system uses runtime instrumentation to detect DMA configuration and data transfer events during firmware execution.
Experimental results
Research questions
- RQ1Can a generic, hardware-independent framework automatically detect and emulate DMA input channels in embedded firmware without source code?
- RQ2How accurately can such a framework identify dynamically configured DMA buffers during firmware execution?
- RQ3What is the performance overhead of integrating DMA emulation into existing firmware analysis pipelines?
- RQ4To what extent does DMA emulation improve code path coverage and vulnerability detection in real-world firmware?
- RQ5Can the framework uncover previously unknown bugs in DMA-dependent firmware that are unreachable without DMA input emulation?
Key findings
- DICE detected 33 out of 37 DMA input channels in 83 benchmarks and sample firmware, achieving a 0% false positive rate and 89% true positive rate.
- It correctly supplied DMA inputs to 21 out of 22 DMA buffers that firmware actually used, enabling execution of previously unreachable code.
- The integration of DICE into P 2 IM introduced only a 3.4% average runtime overhead on execution time.
- In fuzzing real-world firmware, DICE increased code path coverage by up to 79X compared to the original P 2 IM without DMA support.
- DICE uncovered 5 unique, previously unknown vulnerabilities in real firmware that were inaccessible to prior analyzers due to lack of DMA emulation.
- All source code and datasets are publicly available, supporting reproducibility and further research in firmware analysis.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.