From: Cheng Yongkang <teel4res@gmail.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Valentina Manea <valentina.manea.m@gmail.com>,
Shuah Khan <shuah@kernel.org>
Cc: Hongren Zheng <i@zenithal.me>,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 0/2] usb: fix over-reported actual_length in usbip/usbfs
Date: Thu, 29 Oct 2026 07:12:20 -0700 [thread overview]
Message-ID: <179328314073.648427.8311262845412746237@gmail.com> (raw)
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(-)
--
2.34.1
next reply other threads:[~2026-10-29 14:19 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-29 14:12 Cheng Yongkang [this message]
2026-10-29 14:12 ` [PATCH 2/2] usb: usbfs: clamp the copied length to transfer_buffer_length Cheng Yongkang
2026-10-29 14:46 ` sashiko-bot
2026-10-29 14:12 ` [PATCH 1/2] usbip: clear actual_length after a failed receive Cheng Yongkang
2026-10-29 14:32 ` sashiko-bot
2026-10-29 18:42 ` Shuah Khan
2026-10-30 4:13 ` Cheng Yongkang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=179328314073.648427.8311262845412746237@gmail.com \
--to=teel4res@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=i@zenithal.me \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=shuah@kernel.org \
--cc=valentina.manea.m@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox