mirror-linux/drivers/dma/ti
Anders Roxell e63419dbf2 dmaengine: ti: edma: Fix memory allocation size for queue_priority_map
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>
2025-09-02 12:05:18 +05:30
..
Kconfig dmaengine: ti: Do not enable by default during compile testing 2025-06-26 15:34:19 -07:00
Makefile dmaengine: ti: k3-udma: Add PSIL threads for AM62P and J722S 2023-12-21 21:45:18 +05:30
cppi41.c dmaengine: Switch back to struct platform_driver::remove() 2024-10-14 23:50:34 +05:30
dma-crossbar.c dmaengine: Explicitly include correct DT includes 2023-08-01 23:51:27 +05:30
edma.c dmaengine: ti: edma: Fix memory allocation size for queue_priority_map 2025-09-02 12:05:18 +05:30
k3-psil-am62.c dmaengine: ti: k3-psil-am62: Fix SPI PDMA data 2023-11-23 14:15:53 +05:30
k3-psil-am62a.c dmaengine: ti: k3-psil-am62a: Fix SPI PDMA data 2023-11-24 14:14:00 +05:30
k3-psil-am62p.c dmaengine: ti: k3-udma: Add PSIL threads for AM62P and J722S 2023-12-21 21:45:18 +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
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 entry for CSI2RX 2024-01-30 22:14:28 +05:30
k3-psil-j784s4.c dmaengine: ti: k3-psil: Add PSI-L thread support for J784s4 2023-03-31 18:17:06 +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-udma: Add PSIL threads for AM62P and J722S 2023-12-21 21:45:18 +05:30
k3-psil.c dmaengine: ti: add missing MODULE_DESCRIPTION() macros 2024-06-28 13:04:38 +05:30
k3-udma-glue.c dmaengine: ti: k3-udma-glue: Drop skip_fdq argument from k3_udma_glue_reset_rx_chn 2025-02-27 12:38:23 +05:30
k3-udma-private.c dmaengine: Explicitly include correct DT includes 2023-08-01 23:51:27 +05:30
k3-udma.c dmaengine updates for v6.16 2025-06-05 08:49:30 -07:00
k3-udma.h dmaengine: ti: k3-udma: Remove unused declarations 2024-08-28 23:35:13 +05:30
omap-dma.c dmaengine: Switch back to struct platform_driver::remove() 2024-10-14 23:50:34 +05:30