Re: [PATCH 07/10] i2c: usbio: Validate full reply length in split-read loop
From: Sakari Ailus
Date: Fri Dec 04 2026 - 16:08:12 EST
On Thu, Dec 03, 2026 at 06:31:11PM +0000, Lee Jones wrote:
> In usbio_i2c_read(), the split-read loop checks only whether
> usbio_bulk_msg() returned a negative error code before copying rxchunk
> bytes from rbuf->data into msg->buf. On a short USB bulk reply, stale
> bytes remaining in the reused i2c->rwbuf buffer are copied into
> msg->buf and leaked to callers.
>
> Validate that usbio_bulk_msg() returns exactly sizeof(*rbuf) + rxchunk,
> matching the non-split path.
>
> Fixes: daf161343a39 ("i2c: Add Intel USBIO I2C driver")
> Closes: https://sashiko.dev/#/bug/linux-68c6624e-612b-4fc9-94f7-ecb3df8ff838
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Lee Jones <lee@xxxxxxxxxx>
Acked-by: Sakari Ailus <sakari.ailus@xxxxxxxxxxxxxxx>
--
Sakari Ailus