HIGH Introduced in 5.6
dmaengine DeviceRef Underflow
CVE-2026-98344
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
01Description
In the Linux kernel, the following vulnerability has been resolved: dmaengine: Fix device kref underflow in dma_chan_put() dma_chan_get() takes chan->device->ref only on the slow path: /* no kref on fast path */ if (chan->client_count) { __module_get(owner); chan->client_count++; return 0; } if (!try_module_get(owner)) return -ENODEV; if (!dma_device_get(chan->device)) { // calls kref_get_unless_zero() dma_chan_put() drops the ref unconditionally, so every fast-path get/put pair drops one extra device reference. The bug fires when two conditions hold together: a non-private provider has a persistent client holding chan->client_count > 0 and another client cycles dmaengine_get()/dmaengine_put(). When the kref hits zero, the subsequent dma_find_channel() returns NULL even though the provider module is still loaded. Fix this by dropping device->ref only on the last put, matching the single slow-path get.
02KernelScan AI Analysis
Risk summary
A reference counting asymmetry in the DMA engine subsystem causes a device kref to underflow when multiple clients cycle channel acquisitions. This can lead to premature device removal and use-after-free, potentially allowing a local attacker to escalate privileges or crash the kernel.
Vulnerability analysis
The DMA engine subsystem acquires a device reference count only on the first channel allocation (the slow path), but releases it on every channel release. This asymmetry means each subsequent acquire/release cycle drops one extra device reference, causing the count to reach zero prematurely. When that happens, the device is removed from the internal channel list and its memory may be freed while a long-lived client still holds a channel reference, leading to a use-after-free. The fix changes the release path to only drop the device reference when the channel's client count reaches zero, matching the single acquisition on the slow path. The vulnerable code path is reachable from local userspace through normal I/O operations that utilize DMA channels, requiring no special privileges beyond a local account on a system with a non-private DMA provider and at least one persistent DMA client.
Lifecycle
03Fix Versions
| Branch | Introduced | Fixed in | Patch commit |
|---|---|---|---|
| 5.10 | 5.6 | 5.10.271 | 036b527f9257 |
| 5.15 | 5.6 | 5.15.222 | 5fb1797a8c94 |
| 6.1 | 5.6 | 6.1.189 | 57f7f1c6827b |
| 6.12 | 5.6 | 6.12.112 | de2677e57d31 |
| 6.18 | 5.6 | 6.18.54 | 1a0d9b406feb |
| 6.6 | 5.6 | 6.6.158 | 7c3f4ce651d4 |
| 7.2 | 5.6 | 7.2.8 | 77906ac448d2 |
| mainline | 5.6 | 7.3 | 44dab659064e |
| cip/5.10 | 5.6 | 5.10.271-cip78 | 036b527f9257 |
| cip/5.10-rt | 5.6 | 5.10.272-cip79-rt35 | 036b527f9257 |
| cip/6.1 | 5.6 | 6.1.189-cip61 | 57f7f1c6827b |
| cip/6.1-rt | 5.6 | 6.1.189-cip61-rt32 | 57f7f1c6827b |
| cip/6.12 | 5.6 | 6.12.112-cip33 | de2677e57d31 |
04CIP Kernels
State of the newest release of each Civil Infrastructure Platform SLTS tree, from CIP's own fix records.
| CIP tree | State |
|---|---|
| cip/6.12 | Fixed in 6.12.112-cip33 |
| cip/6.1 | Fixed in 6.1.189-cip61 |
| cip/6.1-rt | Fixed in 6.1.189-cip61-rt32 |
| cip/5.10 | Fixed in 5.10.271-cip78 |
| cip/5.10-rt | Fixed in 5.10.272-cip79-rt35 |