Re: [PATCH 2/2] xilinx_dma: Fix read-after-free bug when terminating transfers

From
Vinod Koul <vkoul@kernel.org>
Date
2021-07-14 05:11:38
Also in
linux-arm-kernel
Reply to
Adrian Larumbe, 2021-07-06
On 07-07-21, 00:43, Adrian Larumbe wrote:
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.
Applied after adding subsystem name, thanks

-- 
~Vinod
Thread (13 messages) 13 messages, 4 authors, last reply 2021-11-22
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help