linux/drivers/dma/ti
Anders Roxell 5e462fa0df dmaengine: ti: edma: Fix memory allocation size for queue_priority_map
[ Upstream commit e63419dbf2 ]

Fix a critical memory allocation bug in edma_setup_from_hw() where
queue_priority_map was allocated with insufficient memory. The code
declared queue_priority_map as s8 (*)[2] (pointer to array of 2 s8),
but allocated memory using sizeof(s8) instead of the correct size.

This caused out-of-bounds memory writes when accessing:
  queue_priority_map[i][0] = i;
  queue_priority_map[i][1] = i;

The bug manifested as kernel crashes with "Oops - undefined instruction"
on ARM platforms (BeagleBoard-X15) during EDMA driver probe, as the
memory corruption triggered kernel hardening features on Clang.

Change the allocation to use sizeof(*queue_priority_map) which
automatically gets the correct size for the 2D array structure.

Fixes: 2b6b3b7420 ("ARM/dmaengine: edma: Merge the two drivers under drivers/dma/")
Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
Link: https://lore.kernel.org/r/20250830094953.3038012-1-anders.roxell@linaro.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2025-09-19 16:29:59 +02:00
..
cppi41.c dmaengine: ti: deprecate '#dma-channels' 2022-05-19 22:58:02 +05:30
dma-crossbar.c dmaengine: ti: Add missing put_device in ti_dra7_xbar_route_allocate 2022-06-09 11:30:31 +05:30
edma.c dmaengine: ti: edma: Fix memory allocation size for queue_priority_map 2025-09-19 16:29:59 +02:00
k3-psil-am62.c dmaengine: ti: k3-psil-am62: Update PSIL thread for saul. 2022-04-22 11:30:43 +05:30
k3-psil-am64.c dmaengine: ti: k3-psil: Add initial map for AM64 2020-12-11 21:20:09 +05:30
k3-psil-am654.c dmaengine: ti: k3-psil: make symbols static 2020-01-21 13:10:24 +05:30
k3-psil-j721e.c dmaengine: ti: k3-psil: add additional TX threads for j721e 2022-09-29 21:48:09 +05:30
k3-psil-j721s2.c dmaengine: ti: k3-psil-j721s2: Add psil threads for sa2ul 2022-07-01 17:17:30 +05:30
k3-psil-j7200.c dmaengine: ti: k3-psil: add additional TX threads for j7200 2022-09-29 21:48:09 +05:30
k3-psil-priv.h dmaengine: ti: k3-psil: Add AM62x PSIL and PDMA data 2022-03-11 12:32:53 +05:30
k3-psil.c dmaengine: ti: k3-psil: Add AM62x PSIL and PDMA data 2022-03-11 12:32:53 +05:30
k3-udma-glue.c dmaengine: ti: k3-udma-glue: fix memory leak when register device fail 2022-11-08 10:43:56 +05:30
k3-udma-private.c dmaengine: ti: k3-udma-private: Fix refcount leak bug in of_xudma_dev_get() 2022-09-05 11:53:46 +05:30
k3-udma.c dmaengine: ti: Add NULL check in udma_probe() 2025-06-27 11:07:16 +01:00
k3-udma.h dmaengine: ti: k3-udma-glue: Add support for K3 PKTDMA 2020-12-11 21:20:10 +05:30
Kconfig dmaengine: ti: k3-udma: Drop COMPILE_TEST for the drivers for now 2020-04-15 21:25:25 +05:30
Makefile dmaengine: ti: k3-psil: Add AM62x PSIL and PDMA data 2022-03-11 12:32:53 +05:30
omap-dma.c dma: omap: hide legacy interface 2022-04-22 11:08:43 +02:00