# CVE-2026-143395: net/9p/usbg: Fix use-after-free on usb9pfs\_clear\_tx

- Priority: **Insufficient evidence**
- Reason: No CVSS vector published; no exploitation reported by the 5 checked sources
- Next step: Check the vendor advisory
- Status: published
- Published: 2026-12-03 · Modified: 2026-12-03
- Aliases: DEBIAN-CVE-2026-143395, UBUNTU-CVE-2026-143395
- Record: https://cvemate.com/vulnerability/CVE-2026-143395 · JSON: https://cvemate.com/vulnerability/CVE-2026-143395/json

## Description

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

net/9p/usbg: Fix use-after-free on usb9pfs_clear_tx

When p9_usbg_close() is called, it invokes usb9pfs_clear_tx() but does
not clear usb9pfs->client nor usb9pfs->in_req->context afterwards.
The 9p client core (p9_client_destroy) calls close() and then
kfree(clnt), so after p9_usbg_close returns the client struct is freed.

If the USB gadget is later disabled (e.g., host disconnect),
usb9pfs_disable calls usb9pfs_clear_tx again, which passes the dangling
usb9pfs->client pointer to p9_client_cb. Inside p9_client_cb,
p9_req_put(c, req) dereferences the freed client to access its reqs IDR,
causing a use-after-free.

Additionally, usb9pfs_clear_tx does not clear usb9pfs->in_req->context
after calling p9_client_cb, so a second invocation finds a stale request
pointer and attempts double-completion, further compounding the UAF risk.

Fix by:
1. Clearing usb9pfs->in_req->context to NULL in usb9pfs_clear_tx()
   before checking usb9pfs->client, so that even if the client is gone
   the stale request pointer is consumed and cannot cause
   double-completion.
2. Adding a NULL check on usb9pfs->client in usb9pfs_clear_tx() to skip
   p9_client_cb() when the client has already been destroyed.
3. Setting usb9pfs->client = NULL in p9_usbg_close() after calling
   usb9pfs_clear_tx(), to prevent any subsequent call from dereferencing
   the freed client pointer.
```

## Signals

- CVSS: none published
- EPSS: 0.276%, percentile 21.32%, as of 2026-12-05
- Known exploited (KEV): CISA not listed, ENISA not listed, CIRCL not listed
- Ransomware use: none recorded
- Public exploits: 0

## Affected (first 20 of 171)

- debian linux (Debian): All versions (No fix recorded)
- ubuntu linux (Ubuntu): All versions (No fix recorded)
- ubuntu linux-allwinner-5.19 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.0 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.11 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.13 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.15 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.19 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.3 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.4 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.8 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-6.14 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-6.17 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-6.2 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-6.5 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-6.8 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-7.0 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-fips (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-hwe (Ubuntu): All versions (No fix recorded)

## References

- <https://git.kernel.org/stable/c/e9c79d83affb05663925d81c83e334bf8d230191>
- <https://git.kernel.org/stable/c/6c7901b8667af551f5efe90d67a6f3f6add0c27b>
- <https://git.kernel.org/stable/c/840ae53432e569266879dddcaf06993ec2276ec8>
- <https://git.kernel.org/stable/c/5c69297356bf6d04d8222f52717c6c4aa73e5d2c>
- <https://security-tracker.debian.org/tracker/CVE-2026-143395>
- <https://ubuntu.com/security/CVE-2026-143395>
- <https://www.cve.org/CVERecord?id=CVE-2026-143395>

---

Data as of 2026-12-06T03:42:28.283Z. The priority label is CveMate's own model from public evidence, not an official rating, and it knows nothing about your assets. How labels are decided: https://cvemate.com/faq#priority
