Re: [PATCH 2/2] usb: usbfs: clamp the copied length to transfer_buffer_length
From: Greg Kroah-Hartman
Date: Fri Nov 20 2026 - 03:03:42 EST
On Thu, Oct 29, 2026 at 07:12:20AM -0700, Cheng Yongkang wrote:
> copy_urb_data_to_user() uses urb->actual_length as the number of bytes to
> copy to userspace for non-isochronous URBs. The usbfs contract is that a
> driver must not report more data than the transfer buffer holds, but
> usbfs cannot rely on every HCD or device implementation to honor it; a
> malicious usbip peer can already set actual_length beyond
> transfer_buffer_length and trigger an out-of-bounds read:
No, every HCD must honor this.
thanks,
greg k-h