Re: [PATCH 1/4] HID: Intel-thc-hid: Intel-thc: Add safe DMA read interfaces
From: Jiri Kosina
Date: Thu Nov 19 2026 - 16:18:54 EST
On Mon, 16 Nov 2026, Even Xu wrote:
> THC DMA buffers are rounded up to a 4 KB boundary, but callers may
> allocate smaller receive buffers. Checking a frame against the DMA
> capacity alone does not protect the destination when do DMA buffer
> copying.
>
> Add thc_rxdma_read_safe() and thc_swdma_read_safe() with an explicit
> destination capacity to check both the DMA capacity and the supplied
> size before copying.
>
> Keep the original interfaces as compatibility wrappers.
>
> Fixes: a688404b2e20 ("HID: intel-thc-hid: intel-thc: Add THC DMA interfaces")
> Signed-off-by: Even Xu <even.xu@xxxxxxxxx>
> Tested-by: Rui Zhang <rui1.zhang@xxxxxxxxx>
I have applied the series, thanks.
--
Jiri Kosina
SUSE Labs