linux/drivers/dma/xilinx
Adrian Larumbe 7dd2dd4ff9 dmaengine: xilinx_dma: Fix read-after-free bug when terminating transfers
When user calls dmaengine_terminate_sync, the driver will clean up any
remaining descriptors for all the pending or active transfers that had
previously been submitted. However, this might happen whilst the tasklet is
invoking the DMA callback for the last finished transfer, so by the time it
returns and takes over the channel's spinlock, the list of completed
descriptors it was traversing is no longer valid. This leads to a
read-after-free situation.

Fix it by signalling whether a user-triggered termination has happened by
means of a boolean variable.

Signed-off-by: Adrian Larumbe <adrian.martinezlarumbe@imgtec.com>
Link: https://lore.kernel.org/r/20210706234338.7696-3-adrian.martinezlarumbe@imgtec.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2021-07-14 10:39:34 +05:30
..
Makefile dmaengine: xilinx: dpdma: Add the Xilinx DisplayPort DMA engine driver 2020-07-17 11:37:59 +05:30
xilinx_dma.c dmaengine: xilinx_dma: Fix read-after-free bug when terminating transfers 2021-07-14 10:39:34 +05:30
xilinx_dpdma.c dmaengine updates for v5.14-rc1 2021-07-05 12:05:13 -07:00
zynqmp_dma.c dmaengine: zynqmp_dma: Fix PM reference leak in zynqmp_dma_alloc_chan_resourc() 2021-05-31 09:33:09 +05:30