summaryrefslogtreecommitdiff
path: root/include/linux/platform_data
diff options
context:
space:
mode:
authorAdrian Hunter <adrian.hunter@intel.com>2026-09-20 18:12:31 +0300
committerAlexandre Belloni <alexandre.belloni@bootlin.com>2026-09-21 23:25:36 +0200
commit35b028b25451e17d63b2cd36a11a86c5e18df1b9 (patch)
tree043fb0f53e28499a3416acb818ab6d5372bfce2a /include/linux/platform_data
parent591980aaaa4645e6511f1387cc6092378a6bb84f (diff)
downloadlinux-next-35b028b25451e17d63b2cd36a11a86c5e18df1b9.tar.gz
linux-next-35b028b25451e17d63b2cd36a11a86c5e18df1b9.zip
i3c: master: Fix out-of-bounds read in DMA bounce buffer setup
When a bounce buffer is required for DMA_TO_DEVICE transfers, i3c_master_dma_map_single() rounds the DMA mapping length up to a cache-line boundary: map_len = ALIGN(len, cache_line_size()); It then allocates the bounce buffer with: kmemdup(buf, map_len, GFP_KERNEL); kmemdup() copies the full allocation size, causing it to read map_len bytes from buf even though only len bytes are valid. This results in an out-of-bounds read of up to cache_line_size() - 1 bytes past the end of the caller's buffer. Fix the issue by allocating the bounce buffer with kzalloc() and copying only len bytes from the original buffer. The remaining bytes up to map_len stay zero-filled, avoiding both the out-of-bounds read and exposure of unrelated memory contents to the DMA engine. Fixes: f8d9e56aeb87 ("i3c: master: Add helpers for DMA mapping and bounce buffer handling") Cc: stable@vger.kernel.org Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Reviewed-by: Frank Li <Frank.Li@nxp.com> Link: https://patch.msgid.link/20260920151248.46936-2-adrian.hunter@intel.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Diffstat (limited to 'include/linux/platform_data')
0 files changed, 0 insertions, 0 deletions