# CVE-2025-40004: net/9p: Fix buffer overflow in USB transport layer

- Severity: not scored yet
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.27%, higher than 20% of CVEs (2026-12-01)
- Published: 2025-10-20T05:26:08.787Z
- Modified: 2026-10-19T21:10:00.160Z
- Assigned by: Linux

## Description

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

net/9p: Fix buffer overflow in USB transport layer

A buffer overflow vulnerability exists in the USB 9pfs transport layer
where inconsistent size validation between packet header parsing and
actual data copying allows a malicious USB host to overflow heap buffers.

The issue occurs because:
- usb9pfs_rx_header() validates only the declared size in packet header
- usb9pfs_rx_complete() uses req->actual (actual received bytes) for
memcpy

This allows an attacker to craft packets with small declared size
(bypassing validation) but large actual payload (triggering overflow
in memcpy).

Add validation in usb9pfs_rx_complete() to ensure req->actual does not
exceed the buffer capacity before copying data.

(As written by CVE List.)

## Affected

- Linux Linux: from a3be076dc174d9022a71a12554feb4c97b5c4d5c before 0da18d49f874d444ad83c8a546fa33bfcf2f582c; from a3be076dc174d9022a71a12554feb4c97b5c4d5c before df8462f0fc045b4475dc494a5787a03c972ba2a2; from a3be076dc174d9022a71a12554feb4c97b5c4d5c before c04db81cd0288dfc68b7a0f7d09bd49b40bba451; 6.12 (not affected: before 6.12; from 6.12.53 up to 6.12.*; from 6.17.3 up to 6.17.*; from 6.18 up to *)

## References

- <https://git.kernel.org/stable/c/0da18d49f874d444ad83c8a546fa33bfcf2f582c>
- <https://git.kernel.org/stable/c/df8462f0fc045b4475dc494a5787a03c972ba2a2>
- <https://git.kernel.org/stable/c/c04db81cd0288dfc68b7a0f7d09bd49b40bba451>

## Sources

- CVE List: [CVE-2025-40004](https://www.cve.org/CVERecord?id=CVE-2025-40004), CVE Terms of Use, modified 2026-05-11
- NVD: [CVE-2025-40004](https://nvd.nist.gov/vuln/detail/CVE-2025-40004), Public domain, modified 2026-10-19

---

Page: https://cve.day/CVE-2025-40004 · Whole record: https://cve.day/CVE-2025-40004.json · Rebuilt by cve.day 2026-11-25T22:59:06.567Z
