CVE-2026-99777: net/9p/usbg: remove bogus context initialization in alloc_requests

Published Nov 20, 2026
·
Updated

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

net/9p/usbg: remove bogus context initialization in allocrequests

allocrequests() initializes usb9pfs->inreq->context to point at the struct fusb9pfs instance itself. usb9pfsqueuetx() later overwrites this with the real struct p9reqt pointer before every transmit, and usb9pfstxcomplete() clears it back to NULL after each completion, so inreq->context only ever holds a valid p9reqt once a request has actually been queued.

usb9pfscleartx(), however, can run at any time (mount close, gadget disable) independent of whether a request was ever queued. If it runs before the first usb9pfstransmit(), it reads the leftover sentinel value, type-confuses the struct fusb9pfs pointer as a struct p9reqt, and both writes through it (req->terr = -ECONNRESET) and hands it to p9clientcb(), which manipulates req->wq and req->refcount at bogus offsets inside fusb9pfs. This reliably corrupts memory or panics whenever the transport is torn down before any 9p request has been transmitted, e.g. mounting and immediately unmounting, or a cable disconnect racing the very first request.

usb9pfs->outreq->context is set the same way but is never read by this transport (usb9pfsrxcomplete() identifies the instance via ep->driverdata instead), so it serves no purpose either.

Both endpoints' ->driverdata are already set to usb9pfs in enableendpoint(), which is what the completion handlers actually use to recover the fusb9pfs instance. Just drop the leftover ->context assignments; usbepallocrequest()/allocepreq() already return zeroed requests, so inreq->context correctly starts out NULL.

Affected Software

3 affected componentsFixes available
linux/kernel>=6.12.0<6.12.118
6.12.118
linux/kernel>=6.13.0<6.18.64
6.18.64
linux/kernel>=6.19.0<7.3.5
7.3.5

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade linux/Kernel to a version that resolves this vulnerability.

    Fixed in 6.12.118
  2. Upgrade

    Upgrade linux/Kernel to a version that resolves this vulnerability.

    Fixed in 6.18.64
  3. Upgrade

    Upgrade linux/Kernel to a version that resolves this vulnerability.

    Fixed in 7.3.5
  4. Compensating control

    Remove the leftover endpoint ->context assignments from alloc_requests(); the request contexts should remain zero-initialized until a valid p9_req_t is assigned before transmit.

Frequently Asked Questions

1

When can this issue be triggered?

It can be triggered when the USB 9p transport is torn down before the first 9p request is transmitted. Examples include mounting and immediately unmounting, or a gadget disable or cable disconnect racing the first request.

2

What is the impact of triggering the flaw?

The teardown path type-confuses a struct f_usb9pfs pointer as a struct p9_req_t. It writes to invalid offsets and invokes callbacks on the bogus request, which can reliably corrupt memory or panic the kernel.

3

Is an attacker required to send a malformed 9p request?

No malformed request is described as necessary. The vulnerable condition is teardown occurring before any request has been queued for transmission.

4

What configuration or component is relevant?

The affected code is the Linux kernel USB 9p gadget transport, net/9p/usbg. Systems not using this transport are not described as reaching the vulnerable path.

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