CVE-2026-31607: usbip: validate number_of_packets in usbip_pack_ret_submit()
In the Linux kernel, the following vulnerability has been resolved:
usbip: validate number_of_packets in usbip_pack_ret_submit()
When a USB/IP client receives a RET_SUBMIT response,
usbip_pack_ret_submit() unconditionally overwrites
urb->number_of_packets from the network PDU. This value is
subsequently used as the loop bound in usbip_recv_iso() and
usbip_pad_iso() to iterate over urb->iso_frame_desc[], a flexible
array whose size was fixed at URB allocation time based on the
*original* number_of_packets from the CMD_SUBMIT.
A malicious USB/IP server can set number_of_packets in the response
to a value larger than what was originally submitted, causing a heap
out-of-bounds write when usbip_recv_iso() writes to
urb->iso_frame_desc[i] beyond the allocated region.
KASAN confirmed this with kernel 7.0.0-rc5:
BUG: KASAN: slab-out-of-bounds in usbip_recv_iso+0x46a/0x640
Write of size 4 at addr ffff888106351d40 by task vhci_rx/69
The buggy address is located 0 bytes to the right of
allocated 320-byte region [ffff888106351c00, ffff888106351d40)
The server side (stub_rx.c) and gadget side (vudc_rx.c) already
validate number_of_packets in the CMD_SUBMIT path since commits
c6688ef9f297 ("usbip: fix stub_rx: harden CMD_SUBMIT path to handle
malicious input") and b78d830f0049 ("usbip: fix vudc_rx: harden
CMD_SUBMIT path to handle malicious input"). The server side validates
against USBIP_MAX_ISO_PACKETS because no URB exists yet at that point.
On the client side we have the original URB, so we can use the tighter
bound: the response must not exceed the original number_of_packets.
This mirrors the existing validation of actual_length against
transfer_buffer_length in usbip_recv_xbuff(), which checks the
response value against the original allocation size.
Kelvin Mbogo's series ("usb: usbip: fix integer overflow in
usbip_recv_iso()", v2) hardens the receive-side functions themselves;
this patch complements that work by catching the bad value at its
source -- in usbip_pack_ret_submit() before the overwrite -- and
using the tighter per-URB allocation bound rather than the global
USBIP_MAX_ISO_PACKETS limit.
Fix this by checking rpdu->number_of_packets against
urb->number_of_packets in usbip_pack_ret_submit() before the
overwrite. On violation, clamp to zero so that usbip_recv_iso() and
usbip_pad_iso() safely return early.
Security readout for executives and security teams
Plain-English summary
A malicious USB/IP server can send a forged response that makes an affected Linux client write beyond allocated kernel memory. This could crash the system or potentially compromise kernel confidentiality and integrity. Exposure is concentrated on systems using USB/IP client functionality and connecting to an attacker-controlled or compromised server.
Executive priority
Prioritize immediate assessment of systems using USB/IP, especially where clients can reach untrusted servers. Patch exposed clients urgently because successful triggering corrupts kernel heap memory. Systems not using USB/IP have substantially lower practical urgency, but kernel update status should still be confirmed through vendor guidance.
Technical view
usbip_pack_ret_submit() trusted number_of_packets from a RET_SUBMIT PDU and replaced the URB’s original value. usbip_recv_iso() and usbip_pad_iso() then used the attacker-controlled value to index the fixed-size iso_frame_desc array, causing a heap out-of-bounds write. The kernel fix rejects values exceeding the original per-URB packet count and clamps them to zero.
Likely exposure
Likely exposure is limited to affected Linux kernels operating as USB/IP clients. Exploitation requires the client to process a malicious RET_SUBMIT response from a hostile or compromised USB/IP server. The supplied version data is complex and includes commit identifiers, so confirm applicability through the relevant distribution advisory rather than relying on version strings alone.
Exploitation context
The CVSS 3.1 score is 9.8, reflecting network reachability, low complexity, and possible confidentiality, integrity, and availability impact. However, the bundle marks KEV false and provides no evidence of active exploitation or a public exploit. Practical reach depends on USB/IP client use and server trust boundaries.
Researcher notes
The demonstrated condition was a KASAN slab out-of-bounds write on kernel 7.0.0-rc5. The flaw is CWE-805 and occurs before receive-side ISO processing. The source establishes memory corruption but does not demonstrate code execution, active exploitation, or exploitation reliability. Multiple stable-kernel fix references and Red Hat advisories are provided.
Mitigation direction
Install a vendor-supported kernel containing the usbip_pack_ret_submit() validation fix or an equivalent backport.
Review the applicable Linux distribution advisory to identify fixed packages for each deployed kernel branch.
Disable unnecessary USB/IP client use until patched.
Restrict USB/IP clients from connecting to untrusted or unnecessary servers.
Validation and detection
Inventory systems using USB/IP client functionality and record their running kernel versions.
Check each kernel package against its distribution’s CVE and errata status.
Confirm the installed source or backport validates response packet counts against the original URB allocation.
After updating, verify systems boot the remediated kernel rather than retaining the vulnerable kernel.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
cwe · low confidence lookup
CWE-805: Exact CWE lookup
Use the exact CWE identifier as the starting point before reviewing related ATT&CK behavior. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.
2CVSS vectors
5Timeline events
1ADP providers
19Source links
CVSS vector scores
2 official scores
We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.
CWE links open Glexia weakness intelligence pages with official CWE context, developer remediation guidance, and related CVE mappings.
CWE-805 · source CWE mapping
Buffer Access with Incorrect Length Value
Buffer Access with Incorrect Length Value represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.