RE: [PATCH 1/4] HID: Intel-thc-hid: Intel-thc: Add safe DMA read interfaces
From: Xu, Even
Date: Thu Nov 19 2026 - 19:13:37 EST
Thanks Jiri!
Best Regards,
Even Xu
> -----Original Message-----
> From: Jiri Kosina <jikos@xxxxxxxxxx>
> Sent: Friday, November 20, 2026 5:19 AM
> To: Xu, Even <even.xu@xxxxxxxxx>
> Cc: bentiss@xxxxxxxxxx; srinivas.pandruvada@xxxxxxxxxxxxxxx; linux-
> input@xxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx; Zhang, Rui1
> <rui1.zhang@xxxxxxxxx>
> Subject: Re: [PATCH 1/4] HID: Intel-thc-hid: Intel-thc: Add safe DMA read
> interfaces
>
> 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