usb: fix over-reported actual_length in usbip/usbfs
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest2 patches 7 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | usbip: clear actual_length after a failed receivedrivers/ | +1 | 6 replies | |
| 2/2 | usb: usbfs: clamp the copied length to transfer_buffer_lengthdrivers/ | +5 | 1 reply |
Reviews trailers per patch
1 of 2 patches has a Reviewed-by or Acked-by.
| Patch | Shuah Khan |
|---|---|
| 1/2 | R-b |
| 2/2 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH 0/2] usb: fix over-reported actual_length in usbip/usbfs
The usbip vhci receive error path gives a failed URB back with the peer-supplied actual_length, and usbfs copy_urb_data_to_user() trusts that length for non-isochronous URBs. A malicious usbip peer can make usbfs read past the transfer buffer.
Patch 1 clears actual_length on the vhci receive failure path. Patch 2 clamps the copied length to transfer_buffer_length in usbfs as a defense-in-depth measure for any HCD that violates the actual_length contract.
Cheng Yongkang (2):
usbip: clear actual_length after a failed receive
usb: usbfs: clamp the copied length to transfer_buffer_length
drivers/usb/core/devio.c | 7 +++++-- drivers/usb/usbip/vhci_rx.c | 1 + 2 files changed, 6 insertions(+), 2 deletions(-)
Signature · 1 line
2.34.1