CVE-2026-31607: usbip: validate number_of_packets in usbip_pack_ret_submit()

Published Apr 24, 2026
·
Updated

In the Linux kernel, the following vulnerability has been resolved:

usbip: validate numberofpackets in usbippackretsubmit()

When a USB/IP client receives a RETSUBMIT response, usbippackretsubmit() unconditionally overwrites urb->numberofpackets from the network PDU. This value is subsequently used as the loop bound in usbiprecviso() and usbippadiso() to iterate over urb->isoframedesc[], a flexible array whose size was fixed at URB allocation time based on the original numberofpackets from the CMDSUBMIT.

A malicious USB/IP server can set numberofpackets in the response to a value larger than what was originally submitted, causing a heap out-of-bounds write when usbiprecviso() writes to urb->isoframedesc[i] beyond the allocated region.

KASAN confirmed this with kernel 7.0.0-rc5:

BUG: KASAN: slab-out-of-bounds in usbiprecviso+0x46a/0x640 Write of size 4 at addr ffff888106351d40 by task vhcirx/69

The buggy address is located 0 bytes to the right of allocated 320-byte region [ffff888106351c00, ffff888106351d40)

The server side (stubrx.c) and gadget side (vudcrx.c) already validate numberofpackets in the CMDSUBMIT path since commits c6688ef9f297 ("usbip: fix stubrx: harden CMDSUBMIT path to handle malicious input") and b78d830f0049 ("usbip: fix vudcrx: harden CMDSUBMIT path to handle malicious input"). The server side validates against USBIPMAXISOPACKETS 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 numberofpackets.

This mirrors the existing validation of actuallength against transferbufferlength in usbiprecvxbuff(), which checks the response value against the original allocation size.

Kelvin Mbogo's series ("usb: usbip: fix integer overflow in usbiprecviso()", v2) hardens the receive-side functions themselves; this patch complements that work by catching the bad value at its source -- in usbippackretsubmit() before the overwrite -- and using the tighter per-URB allocation bound rather than the global USBIPMAXISOPACKETS limit.

Fix this by checking rpdu->numberofpackets against urb->numberofpackets in usbippackretsubmit() before the overwrite. On violation, clamp to zero so that usbiprecviso() and usbippadiso() safely return early.

Affected Software

7 affected componentsFixes available
Linux Linux kernel
Linux Linux kernel>=2.6.39<6.6.136
Linux Linux kernel>=6.7<6.12.83
Linux Linux kernel>=6.13<6.18.24
Linux Linux kernel>=6.19<6.19.14
Linux Linux kernel>=7.0<7.0.1
Microsoft azl3 kernel 6.6.134.1-2

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Patch c6688ef9f297
  2. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Patch b78d830f0049
  3. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Patch usbip: validate number_of_packets in usbip_pack_ret_submit()
  4. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Patch usbip_pad_iso() safely return early

Event History

Apr 24, 2026
CVE Published
via MITRE·02:42 PM
Data Sourced
via MITRE·02:42 PM
DescriptionSeverity
Data Sourced
via Red Hat·03:06 PM
DescriptionSeverityAffected Software
Data Sourced
via NVD·03:16 PM
RemedyDescriptionSeverityWeaknessAffected Software
Apr 26, 2026
Data Sourced
via Microsoft·08:01 AM
DescriptionSeverityWeaknessAffected Software
Updated
via Microsoft·08:01 AM
DescriptionSeverity

Frequently Asked Questions

1

What is the severity of CVE-2026-31607?

CVE-2026-31607 has been classified with a medium severity rating due to its potential impact on system stability.

2

How do I fix CVE-2026-31607?

To fix CVE-2026-31607, update your Linux kernel to the latest version that addresses this vulnerability.

3

What happens if CVE-2026-31607 is exploited?

If CVE-2026-31607 is exploited, it could lead to denial of service or instability in USB/IP communication.

4

Which versions of the Linux kernel are affected by CVE-2026-31607?

CVE-2026-31607 affects specific versions of the Linux kernel that do not validate the number_of_packets in the usbip_pack_ret_submit() function.

5

Is there a workaround for CVE-2026-31607 before applying a patch?

Currently, there is no widely recommended workaround for CVE-2026-31607, and patching is the best approach.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203