paper

Quietus: Detecting False Finality in DMA Buffer Reclamation

arXiv:2612.04862

Abstract

Direct memory access (DMA) lets devices read and write memory independently of the CPU, so a driver can safely hand a buffer to a new owner only after every operation that can access that memory has finished. In practice, however, drivers often release or reuse buffers right after requesting a stop or observing a single completion event, which lets queued descriptors, asynchronous completion callbacks, or deferred bounce-buffer copybacks outlive that handoff and overwrite memory that now belongs to the new owner. We call this failure false finality, and catching it requires tracking operations across execution contexts while accounting for the actual retirement guarantees of the underlying DMA provider. We present QUIETUS, a framework that detects unsafe DMA buffer reclamation by checking authority-set finality, the requirement that no hardware or software operation from a buffer's previous use can still access it once a new owner takes over. We formalize this property in Lean and build a verified checker that analyzes reconstructed driver lifecycles using each DMA provider's retirement guarantees. The checker shows how each reported violation occurs within the model and establishes safe retirement only when every modeled path is safe. We applied QUIETUS to Linux and Zephyr and uncovered 32 machine-checked DMA lifecycle violations across 29 drivers, and reproduced representative violations on physical hardware and in kernel emulation, demonstrating writes into a new owner's memory on embedded hardware and use-after-free writes in Linux.