android_kernel_motorola_sm6375/drivers/dma
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Dan Carpenter 84fff8e6f1 dmaengine: nbpfaxi: Fix memory corruption in probe()
commit 188c6ba1dd925849c5d94885c8bbdeb0b3dcf510 upstream.

The nbpf->chan[] array is allocated earlier in the nbpf_probe() function
and it has "num_channels" elements.  These three loops iterate one
element farther than they should and corrupt memory.

The changes to the second loop are more involved.  In this case, we're
copying data from the irqbuf[] array into the nbpf->chan[] array.  If
the data in irqbuf[i] is the error IRQ then we skip it, so the iterators
are not in sync.  I added a check to ensure that we don't go beyond the
end of the irqbuf[] array.  I'm pretty sure this can't happen, but it
seemed harmless to add a check.

On the other hand, after the loop has ended there is a check to ensure
that the "chan" iterator is where we expect it to be.  In the original
code we went one element beyond the end of the array so the iterator
wasn't in the correct place and it would always return -EINVAL.  However,
now it will always be in the correct place.  I deleted the check since
we know the result.

Cc: [email protected]
Fixes: b45b262cef ("dmaengine: add a driver for AMBA AXI NBPF DMAC IP cores")
Signed-off-by: Dan Carpenter <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Vinod Koul <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
2025-08-28 16:21:15 +02:00
..
bestcomm
dw
dw-axi-dmac
dw-edma dmaengine: dw-edma: Fix to enable to issue dma request on DMA processing 2023-05-17 11:35:54 +02:00
hsu
ioat dmaengine: ioatdma: Fix missing kmem_cache_destroy() 2024-07-05 09:08:23 +02:00
ipu
mediatek dmaengine: mediatek: Fix deadlock caused by synchronize_irq() 2023-10-25 11:53:20 +02:00
ppc4xx
qcom
sh dmaengine: shdma: increase size of 'dev_id' 2024-03-01 13:13:33 +01:00
ti dmaengine: ti: edma: fix OF node reference leaks in edma_driver 2025-03-13 12:42:59 +01:00
xilinx dmaengine: xilinx_dma: Set dma_device directions 2025-07-17 18:24:49 +02:00
acpi-dma.c
altera-msgdma.c
amba-pl08x.c
at_hdmac.c
at_hdmac_regs.h
at_xdmac.c dmaengine: at_xdmac: avoid null_prt_deref in at_xdmac_prep_dma_memset 2025-01-09 13:23:31 +01:00
bcm-sba-raid.c
bcm2835-dma.c
coh901318.c
coh901318.h
coh901318_lli.c
dma-axi-dmac.c dmaengine: axi-dmac: fix possible race in remove() 2024-07-05 09:08:19 +02:00
dma-jz4780.c
dmaengine.c
dmaengine.h
dmatest.c dmaengine: Revert "dmaengine: dmatest: Fix dmatest waiting less when interrupted" 2025-06-04 14:32:29 +02:00
ep93xx_dma.c
fsl-edma-common.c
fsl-edma-common.h
fsl-edma.c
fsl-qdma.c dmaengine: fsl-qdma: init irq after reg initialization 2024-03-06 14:36:09 +00:00
fsl_raid.c
fsl_raid.h
fsldma.c
fsldma.h
idma64.c dmaengine: idma64: Add check for dma_set_max_seg_size 2024-06-16 13:28:41 +02:00
idma64.h
img-mdc-dma.c
imx-dma.c
imx-sdma.c dmaengine: imx-sdma: Fix a possible memory leak in sdma_transfer_init 2023-02-06 07:52:48 +01:00
iop-adma.c
iop-adma.h
k3dma.c
Kconfig dmaengine: tegra210-adma: Update dependency to ARCH_TEGRA 2024-03-26 18:22:19 -04:00
lpc18xx-dmamux.c
Makefile
mcf-edma.c dmaengine: mcf-edma: Fix a potential un-allocated memory access 2023-08-16 18:19:24 +02:00
mic_x100_dma.c
mic_x100_dma.h
mmp_pdma.c
mmp_tdma.c
moxart-dma.c
mpc512x_dma.c
mv_xor.c dmaengine: mv_xor: fix child node refcount handling in early exit 2025-01-09 13:23:31 +01:00
mv_xor.h
mv_xor_v2.c dmaengine: mv_xor_v2: Fix an error code. 2023-05-17 11:35:53 +02:00
mxs-dma.c
nbpfaxi.c dmaengine: nbpfaxi: Fix memory corruption in probe() 2025-08-28 16:21:15 +02:00
of-dma.c
owl-dma.c dmaengine: owl: fix register access functions 2024-05-02 16:18:37 +02:00
pch_dma.c
pl330.c dmaengine: Revert "dmaengine: pl330: issue_pending waits until WFP state" 2024-05-17 11:43:46 +02:00
pxa_dma.c dmaengine: pxa_dma: Remove an erroneous BUG_ON() in pxad_free_desc() 2023-11-20 10:30:14 +01:00
s3c24xx-dma.c
sa11x0-dma.c
sirf-dma.c
sprd-dma.c
st_fdma.c
st_fdma.h
ste_dma40.c dmaengine: ste_dma40: Fix PM disable depth imbalance in d40_probe 2023-11-08 11:23:40 +01:00
ste_dma40_ll.c
ste_dma40_ll.h
stm32-dma.c
stm32-dmamux.c
stm32-mdma.c dmaengine: stm32-mdma: correct desc prep when channel running 2023-11-28 16:50:19 +00:00
sun4i-dma.c
sun6i-dma.c
tegra20-apb-dma.c
tegra210-adma.c
timb_dma.c
TODO
txx9dmac.c
txx9dmac.h
uniphier-mdmac.c
virt-dma.c
virt-dma.h
xgene-dma.c
zx_dma.c