Re: [PATCH] HID: mcp2221: fix slab-out-of-bounds in mcp2221_raw_event() Inbox

From: Jiri Kosina

Date: Fri Oct 31 2025 - 05:20:00 EST


On Sun, 26 Oct 2025, Atharv Dubey wrote:

> From: Atharv Dubey <atharvd440@xxxxxxxxx <athrvd440@xxxxxxxxx>>
>
> A negative idx value could cause a slab-out-of-bounds access
> when indexing the report buffer in mcp2221_raw_event().
>
> Add a check to ensure that idx is greater than or equal to zero
> before accessing the buffer, preventing invalid memory access
> and potential kernel crashes.
>
> Fixes: 3a8660878839 ("KASAN: slab-out-of-bounds Read in mcp2221_raw_event
> (2)")
> Reported-by: syzbot+1018672fe70298606e5f@xxxxxxxxxxxxxxxxxxxxxxxxx
> Signed-off-by: Atharv Dubey <atharvd440@xxxxxxxxx>

Thanks a lot for the fix.

The patch has however been line-wrapped and damaged by yolur mail client.
Could you please look [1] into fixing that and resubmit?

[1] https://docs.kernel.org/process/email-clients.html

Thanks,

--
Jiri Kosina
SUSE Labs