CVE-2026-139000: i3c: master: Fix out-of-bounds read in DMA bounce buffer setup
In the Linux kernel, the following vulnerability has been resolved:
i3c: master: Fix out-of-bounds read in DMA bounce buffer setup
When a bounce buffer is required for DMATODEVICE transfers, i3cmasterdmamapsingle() rounds the DMA mapping length up to a cache-line boundary:
maplen = ALIGN(len, cachelinesize());
It then allocates the bounce buffer with:
kmemdup(buf, maplen, GFPKERNEL);
kmemdup() copies the full allocation size, causing it to read maplen bytes from buf even though only len bytes are valid. This results in an out-of-bounds read of up to cachelinesize() - 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 maplen stay zero-filled, avoiding both the out-of-bounds read and exposure of unrelated memory contents to the DMA engine.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Compensating control
In i3c_master_dma_map_single(), allocate the DMA bounce buffer with kzalloc() and copy only len bytes from the caller's buffer, leaving the remaining bytes zero-filled.