Three tracking plugins are designed and implemented in the fault detection mechanism.
The I/O operations performed by firmware accessing unknown peripherals are intercepted and forwarded to aunified symbolic peripheral. We implemented it based on Avatar2,which implements a remote memory mechanism in which accessesto unmapped memory regions in QEMU are forwarded to a pythonscript. We modified the python script as the symbolic peripheralwith ability of the hybrid event generation.
The avatar uses GDB interface to synchronizestate of register and memory, but it must be issued when the target isstopped. In our scenario, we can not predicate the point of firmwareexecution that accesses unknown peripherals and set break points before hand. We overcame this issue by invoking the QEMU internal function to suspend the firmware execution when encountering unknown peripherals on the fly. We implemented the on-the-fly state transfer by exporting all RAM regions through shared memory based inter-process communication. A POSIX shared memory object is created and bound to the RAM region using mmap when a RAM region is created in QEMU. As a result, the symbolic enginecan directly address the firmware RAM by reading the exported shared memory.
A shared bitmap is created at the first time the IoT firmware image is executed. The bitmap is used to store the information about unique block to block transitions. We implemented it based on AFL's QEMU mode. In addition, a shared list in Python is established at the same time, which is used to store the unique peripheral access to peripheral access transitions. And a Python map between each peripheral access point and its seed queue information is created. These feedback information is shared between QEMU and Python in the shared memory.
The avatar uses GDB interface to synchronizestate of register and memory, but it must be issued when the target isstopped. In our scenario, we can not predicate the point of firmwareexecution that accesses unknown peripherals and set break points before hand. We overcame this issue by invoking the QEMU internal function to suspend the firmware execution when encountering unknown peripherals on the fly. We implemented the on-the-fly state transfer by exporting all RAM regions through shared memory based inter-process communication. A POSIX shared memory object is created and bound to the RAM region using mmap when a RAM region is created in QEMU. As a result, the symbolic enginecan directly address the firmware RAM by reading the exported shared memory.