]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
dmaengine: tegra-apb: Prevent race conditions of tasklet vs free list
authorDmitry Osipenko <digetx@gmail.com>
Sun, 9 Feb 2020 16:33:39 +0000 (19:33 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 11 Mar 2020 06:53:12 +0000 (07:53 +0100)
commit40db8f468fe0895daf042f3f718c6034d02b5ca6
tree4adfe7d12cfef523de8d58c0c6685cef2de09ede
parentd764b388b1aa5192f722b181ddf5ae8b0cc39d54
dmaengine: tegra-apb: Prevent race conditions of tasklet vs free list

commit c33ee1301c393a241d6424e36eff1071811b1064 upstream.

The interrupt handler puts a half-completed DMA descriptor on a free list
and then schedules tasklet to process bottom half of the descriptor that
executes client's callback, this creates possibility to pick up the busy
descriptor from the free list. Thus, let's disallow descriptor's re-use
until it is fully processed.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Acked-by: Jon Hunter <jonathanh@nvidia.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20200209163356.6439-3-digetx@gmail.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/dma/tegra20-apb-dma.c