# CVE-2026-139525: dmaengine: switchtec-dma: fix resource leak in alloc_chan_resources

- Severity: not scored yet
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.19%, higher than 9% of CVEs (2026-12-01)
- Published: 2026-11-30T13:35:33.539Z
- Modified: 2026-11-30T14:19:28.897Z
- Assigned by: Linux

## Description

In the Linux kernel, the following vulnerability has been resolved:

dmaengine: switchtec-dma: fix resource leak in alloc_chan_resources

switchtec_dma_alloc_chan_resources() returns directly on any later
failure, without ever freeing the descriptor rings and coherent DMA
memory it just allocated. The dmaengine core does not call
device_free_chan_resources() when device_alloc_chan_resources() fails,
so the driver has to unwind its own partial state.

The device-removed check also runs after ring_active and
comp_ring_active have already been set true, so a failure there left
the channel marked active despite alloc_chan_resources() reporting
failure.

Add an error-unwind path that disables the channel and frees the
descriptor rings on every failure after allocation. ring_active and
comp_ring_active are cleared under the same locks
switchtec_dma_free_chan_resources() already uses, since the completion
tasklet checks comp_ring_active under complete_lock before touching
the completion ring, and a stale IRQ can still be in flight when this
unwind path runs.

(As written by CVE List.)

## Affected

- Linux Linux: from 30eba9df76adf1294e88214dbf9cea402fa7af37 before 40c59812a3193d01fc52be22f86eb485f37a27de; from 30eba9df76adf1294e88214dbf9cea402fa7af37 before 1188942d6160b9f799af297bdb5d7812cd7fde6d; 7.1 (not affected: before 7.1; from 7.3.6 up to 7.3.*; from 7.4-rc1 up to *)

## References

- <https://git.kernel.org/stable/c/40c59812a3193d01fc52be22f86eb485f37a27de>
- <https://git.kernel.org/stable/c/1188942d6160b9f799af297bdb5d7812cd7fde6d>

## Sources

- CVE List: [CVE-2026-139525](https://www.cve.org/CVERecord?id=CVE-2026-139525), CVE Terms of Use, modified 2026-11-30
- NVD: [CVE-2026-139525](https://nvd.nist.gov/vuln/detail/CVE-2026-139525), Public domain, modified 2026-11-30

---

Page: https://cve.day/CVE-2026-139525 · Whole record: https://cve.day/CVE-2026-139525.json · Rebuilt by cve.day 2026-11-30T14:33:27.242Z
