1
0
Fork 0
alistair23-linux/drivers/dma/dw-edma
Dan Carpenter b77e0283ef dmaengine: dw-edma: Fix use after free in dw_edma_alloc_chunk()
commit 595a334148 upstream.

If the dw_edma_alloc_burst() function fails then we free "chunk" but
it's still on the "desc->chunk->list" list so it will lead to a use
after free.  Also the "->chunks_alloc" count is incremented when it
shouldn't be.

In current kernels small allocations are guaranteed to succeed and
dw_edma_alloc_burst() can't fail so this will not actually affect
runtime.

Fixes: e63d79d1ff ("dmaengine: Add Synopsys eDMA IP core driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Gustavo Pimentel <gustavo.pimentel@synopsys.com>
Link: https://lore.kernel.org/r/X9dTBFrUPEvvW7qc@mwanda
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-01-17 14:05:35 +01:00
..
Kconfig dmaengine: dw-edma: Fix build error without CONFIG_PCI_MSI 2019-06-12 10:22:02 +05:30
Makefile dmaengine: Add Synopsys eDMA IP PCIe glue-logic 2019-06-10 13:10:39 +05:30
dw-edma-core.c dmaengine: dw-edma: Fix use after free in dw_edma_alloc_chunk() 2021-01-17 14:05:35 +01:00
dw-edma-core.h dmaengine: dw-edma: fix __iomem type confusion 2019-07-22 20:58:00 +05:30
dw-edma-pcie.c dmaengine: dw-edma: fix __iomem type confusion 2019-07-22 20:58:00 +05:30
dw-edma-v0-core.c dmaengine: dw-edma: fix endianess confusion 2019-07-22 20:58:15 +05:30
dw-edma-v0-core.h dmaengine: Add Synopsys eDMA IP version 0 support 2019-06-10 13:10:39 +05:30
dw-edma-v0-debugfs.c dmaengine: dw-edma: fix __iomem type confusion 2019-07-22 20:58:00 +05:30
dw-edma-v0-debugfs.h dmaengine: Add Synopsys eDMA IP version 0 debugfs support 2019-06-10 13:10:39 +05:30
dw-edma-v0-regs.h dmaengine: Add Synopsys eDMA IP version 0 support 2019-06-10 13:10:39 +05:30