CVE-2026-139526: dmaengine: switchtec-dma: fix double-free in switchtec_dma_free_desc()
In the Linux kernel, the following vulnerability has been resolved:
dmaengine: switchtec-dma: fix double-free in switchtecdmafreedesc()
switchtecdmafreedesc() frees swdmachan->hwsq, hwcq, and every descring[] entry without clearing the pointers afterward. If switchtecdmaallocchanresources() fails partway through and calls it during unwind, then a later retry of allocchanresources() fails in switchtecdmaallocdesc() before reallocating one of those pointers, its own failure path calls switchtecdmafreedesc() again and frees the same, already-freed pointers a second time.
NULL out each pointer as it's freed so a subsequent call is a no-op for anything already released.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Compensating control
In switchtec_dma_free_desc(), set each pointer to NULL after freeing it so subsequent calls are no-ops.
Event History
Frequently Asked Questions
Under what conditions can the double-free occur?
It requires a channel resource allocation to fail partway through, followed by a retry that also fails before all previously freed descriptor pointers are reallocated. The later failure cleanup can then free stale pointers from the earlier unwind a second time.
What component is involved?
The issue is in the Linux kernel switchtec-dma DMA engine driver, specifically its descriptor cleanup and channel resource allocation failure paths.
What is the mitigation if an update cannot be applied immediately?
The provided information does not identify a configuration workaround. Avoiding or investigating repeated failed switchtec-dma channel resource allocation attempts may help identify exposure, but the described fix is to clear each pointer when it is freed.