Re: [PATCH v3] HID: cp2112: Add parameter validation to data length

From: Jiri Kosina

Date: Tue Oct 14 2025 - 05:47:37 EST


On Fri, 26 Sep 2025, Deepak Sharma wrote:

> Syzkaller reported a stack OOB access in cp2112_write_req caused by lack
> of parameter validation for the user input in I2C SMBUS ioctl in cp2112
> driver
>
> Add the parameter validation for the data->block[0] to be bounded by
> I2C_SMBUS_BLOCK_MAX + the additional compatibility padding
>
> Reported-by: syzbot+7617e19c8a59edfbd879@xxxxxxxxxxxxxxxxxxxxxxxxx
> Closes: https://syzkaller.appspot.com/bug?extid=7617e19c8a59edfbd879
> Tested-by: syzbot+7617e19c8a59edfbd879@xxxxxxxxxxxxxxxxxxxxxxxxx
> Signed-off-by: Deepak Sharma <deepak.sharma.472935@xxxxxxxxx>

Applied to hid.git#for-6.18/upstream-fixes, thanks.

--
Jiri Kosina
SUSE Labs