dmaengine: dw-edma: Serialize channel state checks
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ e63d79d1ffcd2201a2dbff1d7a1184b8f3ec74cf · < fe0ffa0190e862ed71e8c1a476090f648c9cb7d9| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
dmaengine: dw-edma: Serialize channel state checks
pause() and resume() read and update channel state without holding vc.lock, while the interrupt handlers update the same state under it. Take the same lock around those state checks so that request, status, and configured stay consistent.
For example, pause() can observe EDMA_ST_BUSY right before the interrupt handler completes the final descriptor and moves the channel to EDMA_ST_IDLE, and then record EDMA_REQ_PAUSE on an already idle channel. No further interrupt will acknowledge the request, and since issue_pending() requires EDMA_REQ_NONE, the channel is wedged for good: terminate_all() leaves the stale request behind, so even reconfiguring the channel does not recover it.
issue_pending() already runs under vc.lock, but it tests configured before taking it. Move that test under the lock as well, so configured, request, and status are evaluated as one channel-state snapshot.
From the CVE record · Linux
The Linux kernel dw-edma driver checks and updates channel state without consistently holding the channel lock. A race between pause or resume and an interrupt handler can leave a stale pause request that permanently stalls the channel, even after termination and reconfiguration. The input does not establish whether an attacker can trigger this, or specify access or interaction requirements.
Engineers running Linux kernels with the dw-edma dmaengine driver should check their kernel; affected versions are not specified.