CVE-2026-139740: dmaengine: xilinx_dma: Move descriptors to done list based on completion bit
In the Linux kernel, the following vulnerability has been resolved:
dmaengine: xilinxdma: Move descriptors to done list based on completion bit
In AXI MCDMA, xilinxdmacompletedescriptor() walks the channel's activelist and unconditionally moves every entry to the donelist. The MCDMA IOC interrupt handler invokes this function on every interrupt-on-completion, but with interrupt coalescing (IRQThreshold > 1) an IOC interrupt may fire after only a subset of the queued descriptors have actually been processed by the hardware. As a result, descriptors whose completion bit is not yet set in the BD status were being reported as completed to client drivers.
Add a check for the descriptor completion bit before moving entries from the active list to the done list, using the appropriate direction- specific status field (s2mmstatus for DMADEVTOMEM, mm2sstatus for DMAMEMTODEV).
This mirrors the AXIDMA fix in commit 7bcdaa658102 ("dmaengine: xilinxdma: Freeup active list based on descriptor completion bit").
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Compensating control
Update xilinx_dma_complete_descriptor() to check the descriptor completion bit before moving an entry from active_list to done_list. Check s2mm_status for DMA_DEV_TO_MEM and mm2s_status for DMA_MEM_TO_DEV, and leave descriptors whose completion bit is unset on active_list.
Event History
Frequently Asked Questions
Which systems are exposed to this issue?
Systems using the Linux kernel's Xilinx AXI MCDMA driver are affected when descriptors are queued on a channel. The issue specifically concerns interrupt-on-completion handling in AXI MCDMA.
What configuration makes the incorrect completion reporting more likely?
The issue occurs with interrupt coalescing enabled and IRQThreshold greater than 1. In that configuration, an IOC interrupt can occur after only some queued descriptors have been processed.
What is the practical effect of the flaw?
The driver can report descriptors as completed to client drivers before the hardware has set their completion bits. This can cause clients to treat unprocessed DMA work as complete.
How is the issue fixed?
The fix checks each descriptor's direction-specific completion status before moving it from the active list to the done list. It uses s2mm_status for DMA_DEV_TO_MEM and mm2s_status for DMA_MEM_TO_DEV.