---
title: "P2IM: Scalable and Hardware-independent Firmware Testing via Automatic Peripheral Interface Modeling"
url: https://awesomerea.org/papers/paper-p2im/
updated: 2026-11-09
type: paper
---

# P2IM: Scalable and Hardware-independent Firmware Testing via Automatic Peripheral Interface Modeling

> P2IM emulates monolithic ARM Cortex-M firmware in a modified QEMU by classifying memory-mapped I/O registers as control-status, status, data or control-data during speculative execution runs and feeding fuzzer inputs through data registers and round-robin interrupts.

- Authors: Bo Feng; Alejandro Mera; Long Lu
- Venue: USENIX Security 2020
- Status: Conference paper
- Publication / posting date: August 2020
- Date source: The official USENIX Security 2020 proceedings page gives August 2020. Month precision is retained rather than treating the conference schedule as a publication day.
- First arXiv submission: September 13, 2019
- arXiv: 1909.06472
- Read in a terminal: `hf papers read 1909.06472`
- Reviewed arXiv version: v3
- Sources reviewed: 2026-10-18
- Added to the catalog: 2026-11-09
- Original paper: <https://www.usenix.org/conference/usenixsecurity20/presentation/feng>
- PDF: <https://www.usenix.org/system/files/sec20-feng.pdf>
- Code: <https://github.com/RiS3-Lab/p2im>
- BibTeX: <https://awesomerea.org/papers/citations/paper-p2im.bib>
- Catalog page: <https://awesomerea.org/papers/paper-p2im/>
- Record JSON: <https://awesomerea.org/papers/paper-p2im/record.json>
- Chinese version: [简体中文](https://awesomerea.org/zh/papers/paper-p2im/index.md)

## Scope and limitations

Scoped to processor-peripheral interfaces in monolithic ARM Cortex-M firmware without OS kernels; DMA, nuanced interrupt timing and external bus devices are outside its model, and it assumes firmware runs through peripheral abstraction layers (HAL/driver libraries). Misclassified registers, unmodeled hardware semantics or unsupported MCU layouts can stall booting or cause false crashes and hangs. Evaluating 70 sample programs and 10 real-world device firmwares establishes a fuzzing environment for fuzzing.

## Why it fits this collection

Establishes access-pattern-based MMIO register classification for hardware-independent Cortex-M firmware rehosting, complementing library-matching rehosting in HALucinator and symbolic MMIO modeling in Fuzzware.

## Publication and review notes

The sources are the 18-page USENIX Security 2020 proceedings PDF (pages 1237–1254) and arXiv 1909.06472v3 (submitted 2019-09-13, v3 dated 2020-06-15); the USENIX page lists no publisher DOI. The linked RiS3-Lab/p2im repository is licensed under GPL-2.0 at the root while tracking patched AFL, QEMU and unit_testing submodules separately. Its documentation targets 64-bit Ubuntu 16.04/18.04, GCC and the GNU Arm Embedded Toolchain, and requires manual fuzz.cfg setup (MCU model, ROM/RAM layout and interrupt interval) plus firmware-specific input instrumentation when applications read peripheral buffers indirectly.

## BibTeX

```bibtex
@inproceedings{paper-p2im,
  title = {{P2IM: Scalable and Hardware-independent Firmware Testing via Automatic Peripheral Interface Modeling}},
  author = {{Bo Feng} and {Alejandro Mera} and {Long Lu}},
  year = {2020},
  url = {https://www.usenix.org/conference/usenixsecurity20/presentation/feng},
  booktitle = {29th USENIX Security Symposium (USENIX Security 20)},
  pages = {1237--1254},
  publisher = {USENIX Association},
  eprint = {1909.06472},
  archivePrefix = {arXiv},
  month = aug
}
```

## Primary sources

1. <https://www.usenix.org/conference/usenixsecurity20/presentation/feng>
2. <https://www.usenix.org/system/files/sec20-feng.pdf>
3. <https://arxiv.org/abs/1909.06472>
4. <https://arxiv.org/abs/1909.06472v3>
5. <https://arxiv.org/pdf/1909.06472v3.pdf>
6. <https://github.com/RiS3-Lab/p2im/blob/0e64506a371b9c66ff67ed64a3fa65fa7e197e21/README.md>
7. <https://github.com/RiS3-Lab/p2im/blob/0e64506a371b9c66ff67ed64a3fa65fa7e197e21/LICENSE>
8. <https://github.com/RiS3-Lab/p2im/blob/0e64506a371b9c66ff67ed64a3fa65fa7e197e21/.gitmodules>
9. <https://github.com/RiS3-Lab/p2im/blob/0e64506a371b9c66ff67ed64a3fa65fa7e197e21/docs/build_qemu.md>
10. <https://github.com/RiS3-Lab/p2im/blob/0e64506a371b9c66ff67ed64a3fa65fa7e197e21/docs/prep_fw_for_fuzzing.md>
11. <https://github.com/RiS3-Lab/p2im/blob/0e64506a371b9c66ff67ed64a3fa65fa7e197e21/fuzzing/templates/fuzz.cfg.template>

## About this entry

Reviewed against the paper and its primary sources. Cite the original authors using the linked paper or BibTeX.
Original editorial content: MIT. Linked projects, papers and assets retain their own rights and licenses.
