dmaengine: fix use-after-free in dma_chan_put() and dma_release_channel()
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 8ad342a863590b24ce77681b7e081363fb3333f7 · < 6cf31716b77a71c0d634106f4f3951377b8dc6dc| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
dmaengine: fix use-after-free in dma_chan_put() and dma_release_channel()
When dma_device_put() drops the last reference on chan->device->ref, dma_device_release() runs and may free the dma_device along with its channels.
dma_chan_put() then still reads chan->device->owner via dma_chan_to_owner() for the trailing module_put(). KASAN catches it:
slab-use-after-free in dma_chan_put+0x3e6/0x4c0 Read of size 8 by task insmod/6319 Freed by task 6319: kfree+0x225/0x470 dma_chan_put+0x395/0x4c0 dmaengine_put+0xf8/0x160
Cache the module owner in dma_chan_put() before the put so the trailing module_put() does not need chan->device.
From the CVE record · Linux
The Linux kernel can read freed memory in dma_chan_put() after dma_device_put() releases a DMA device and its channels. KASAN detected the issue in a local insmod task; the input does not establish an attacker path, authentication requirements, or user interaction.
Engineers running the Linux kernel should check their deployments; affected versions are not specified.