Linux kernel use-after-free in Marvell mcam DMA shutdown
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
media: marvell: mcam: stop DMA and cancel s_bh_work before freeing DMA buffers
In vmalloc mode the frame-completion IRQ queues mcam_frame_work() on cam->s_bh_work, which memcpy()s from the dma_bufs[] that mcam_free_dma_bufs() frees with dma_free_coherent(). mccic_shutdown() frees those buffers without stopping the controller, so while streaming a late frame IRQ can re-arm the work after the buffers are gone, causing a use-after-free.
Stop the controller in mccic_shutdown() when streaming is still active (gated on an open fd, which holds a runtime-PM reference, so the device is powered), cancel s_bh_work in mcam_free_dma_bufs(), and move INIT_WORK() into mccic_register() before the device can be published.
From the CVE record · Linux
In the Linux kernel’s Marvell mcam driver, a late frame interrupt can queue work that accesses DMA buffers after they have been freed. This can cause a use-after-free when streaming is active in vmalloc mode during shutdown. The input does not specify an attacker access path or authentication requirement.
Engineers running Linux kernels with the Marvell mcam driver should check their installations; affected versions are not specified.