The Jerusalem PostTrump says renewed Israeli strikes on Iran 'make sense' as Tehran vows to keep Hormuz closedInquirerTie white ribbons on Christmas trees to reject corruption, bishop urgesDaily MaverickSELLING SECRETS: Gqeberha cop in the dock for alleged ties to perlemoen ‘kingpin'Straits Times SportFrench Alps 2030 events moved due to environmental concernsRTP DesportoTécnico do Nacional pede mentalidade competitiva na receção ao BenficaIl Fatto QuotidianoLupi da eliminare, l’ufficio stampa lo chiama piano di “protezione” ma l’assessore piemontese si infuria: “Ne uccidiamo 23”BBC News BrasilMoraes e Toffoli votam a favor de lei da dosimetria, que pode reduzir pena de Bolsonaro; acompanhe o julgamento20 MinutenSeltene Sichtung: Cybertruck auf dem Weg nach DavosVilaWebL’Audiència espanyola considera inútil de preguntar a l’Aràbia Saudita sobre l’origen de les joies de ZapateroBBC SportO'Neill wants January signings to boost 'physically lightweight' CelticESPN DeportesMLBPA comenzará a pagar estipendios durante cierre patronalTVN24Cyberatak na szpital. Wyciekły dane blisko czterech milionów osób
The Daily Newsstand · Free, Always
Friday, December 4, 2026
Automatic translation is active. Articles in other languages will open in English.Enable automatic translation of articles from other languages into English.

Researchers Find 32 DMA Management Bugs in Linux and Zephyr and Formally Verify Safe Cleanup With Quietus

The article's text, from Joho no Todai's page.

Translate

Direct memory access (DMA) lets peripherals read and write memory without the CPU handling each step of the transfer. Before freeing a memory region used as a transfer buffer, the driver must ensure that earlier operations can no longer access it in conflicting ways.

A New York University team submitted a paper on December 3, 2026 (UTC), describing Quietus, a verification method for safely reusing DMA buffers. The paper is titled "Quietus: Detecting False Finality in DMA Buffer Reclamation."

The team found 32 issues across 29 drivers in Linux and Zephyr, a real-time operating system for embedded devices. When drivers freed memory or handed it off for reuse, earlier operations could still interfere with the memory or related state.

For representative cases, the researchers used embedded hardware and environments that emulate the kernel. They observed corruption of reassigned memory and writes to memory that had been freed.

When software considers an operation finished and when memory is safe to reuse can be two different points. That gap is an interesting and difficult property of a technology built to make computers faster.

Work can remain after the hardware stops

A request to stop a DMA transfer may return before the hardware finishes. A transfer may still be in flight, and other transfer requests may be queued.

Software can also do more work after the hardware finishes. For example, a callback can run after a transfer completion notification. When hardware cannot access the destination directly, software may use a temporary buffer and have the CPU copy the data to the original destination afterward.

A Zephyr serial driver for STM32 could leave DMA writes outstanding after handing memory back to the application. In tests on hardware, the researchers observed corruption of data in reassigned memory.

In Linux’s SH Mobile I²C driver, the receive error path could free a buffer before all activity involving that buffer had completed. As a result, later software copyback could write to freed kernel memory.

In Linux’s Samsung serial driver, a delayed completion callback could update an already reset counter for the amount of data in the transmit buffer. The researchers observed the driver getting stuck waiting for transmission to finish in an emulated environment.

Hardware transfers, software copyback, and updates to driver state produce different symptoms, but in each case earlier work interferes with later work. The researchers call it false finality, or treating an operation as finished before it actually is.

Verifying completion guarantees with mathematics

Quietus separately tracks the kinds of memory access that hardware and software might still perform. At the point where ownership changes, it checks whether earlier work can still produce any conflicting access. When another operation takes exclusive ownership, earlier reads and writes both matter. When the memory is shared read-only, earlier writes are the concern.

The team formalized these conditions in Lean, a proof assistant for checking mathematical proofs. For existing C drivers, the researchers reconstruct execution paths in a model by following calls, branches, and callbacks.

The model includes the conditions under which the DMA controller guarantees that work has finished. When the code does not establish the hardware behavior, the model treats the guarantee as unknown.

For an unknown shutdown condition, Quietus considers combinations in which the relevant guarantees do and do not hold. If a path leaves a conflicting access across all combinations, the model identifies how the guarantee fails. To prove a handoff safe, the model must cover the relevant operations and paths, and conflicting accesses must be gone on every path to the handoff under every set of conditions. The handoff must also be reachable, each modeled path must be executable as expected, and earlier handoffs must be free of violations.

If there is too little information to establish safety or a violation, the result is unresolved. There is value in leaving unknown conditions unresolved. Finding potential problems and proving that problems cannot occur require different levels of information.

What the team found in real drivers

The researchers surveyed 157 files for Linux drivers that use DMAengine, the kernel’s common DMA framework. They also examined other Linux subsystems and Zephyr drivers.

They found 19 issues through manual review and early searches while developing the model. Rules for spotting recurring patterns turned up another 13.

The paper’s evaluation reports 28 issues in 25 Linux drivers and four in four Zephyr drivers. More than half of the 32 cases involved a stop request that did not wait for completion, a timeout, or an error.

The way the team narrowed the candidates is instructive. Applying a search rule for DMA mapping teardown order to the 157 Linux files flagged 52 sites. Quietus found model-level violations at 26 of them.

The team reviewed the source and confirmed 14 issues across 19 sites. Of the remaining seven, six were false positives and one was unreachable under the relevant kernel configuration.

Applying a verification result to a real driver requires tracking which memory a buffer refers to, which paths can execute, and what the controller guarantees. Both the proof and the model must be correct.

The 32 findings were checked against source code and controller specifications. The hardware and emulation tests used representative cases. The study also did not measure how often the bugs occur across either OS. Actual corruption can depend on execution order, DMA configuration, and how long the hardware takes to finish.

The team also verified the SH Mobile bug with KASAN, the Linux kernel’s memory error detector. A controlled runtime test detected a write to freed memory during CPU copyback. Runtime checking observes the paths a test exercises, while Quietus can also examine modeled error paths. The two approaches complement each other.

At the time of submission, the researchers said they had reported 22 of the 32 findings to maintainers with proposed fixes or verification materials and were preparing reports for the remaining ten.

The repair depends on getting the order right

The Linux DMAengine documentation describes asynchronous termination and when it is safe to free memory.

An asynchronous stop request through dmaengine_terminate_async() may return before transfers or running callbacks finish. Before freeing memory used by those transfers or callbacks, drivers must call dmaengine_synchronize() to wait for completion. The behavior is undefined if dma_async_issue_pending() is called between termination and synchronization.

Synchronous termination through dmaengine_terminate_sync() waits for transfers and running callbacks to finish. It must not be called in atomic context, where waiting is prohibited, or from a completion callback.

In the Samsung driver, the researchers found that a synchronous wait could deadlock if it depended on a callback that needed a lock already held by the waiting code.

The researchers explored a fix that uses internal driver state to prevent stale callbacks from applying invalid updates without waiting for them. Races remained in the first two proposals.

To verify the third proposal, the team built a separate Lean model specific to the driver that included callback state. It proved that a callback would not subtract transmit data that had already been discarded. The proof covers that property. Establishing that the entire driver is free of deadlocks would require separate verification.

Even where waiting seems like the natural fix, the wait itself can introduce a problem. Expressing the required property mathematically lets developers verify what a proposed repair guarantees. The research helps both find defects and understand what their fixes achieve.

Japan’s Renesas Electronics lists support for Zephyr on a range of RA, RX, and RZ devices and evaluation boards. Safe memory handoff is also relevant to embedded developers evaluating the completion guarantees of their drivers and controllers.

DMA transfers data independently of the CPU. Reusing memory safely while keeping that independence depends on how precisely software can verify that the work is done. The guarantee of completion is as valuable as the speed of the transfer.

View the original on Joho no Todai →