# CVE-2025-40027: net/9p: fix double req put in p9\_fd\_cancelled

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** HIGH 7.8
- **CVSS:** 7.8 (v3.1, CNA) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: High; Integrity impact: High; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.25% (percentile 10, 2026-11-26)
- **Published:** 2025-10-28T09:32:34.162Z
- **Modified:** 2026-10-19T21:10:00.160Z

## Who should check

- Anyone running Linux \>= afd8d65411551839b7ab14a539d00075b2793451, \< a5901a0dfb5964525990106706ae8b98db098226; \>= afd8d65411551839b7ab14a539d00075b2793451, \< 5c64c0b7b3446f7ed088a13bc8d7487d66534cbb; \>= afd8d65411551839b7ab14a539d00075b2793451, \< c1db864270eb7fea94a9ef201da0c9dc1cbab7b8; \>= afd8d65411551839b7ab14a539d00075b2793451, \< 0e0097005abc02c9f262370674f855625f4f3fb4; \>= afd8d65411551839b7ab14a539d00075b2793451, \< 284e67a93b8c48952b6fc82129a8d3eb9dc73b06; \>= afd8d65411551839b7ab14a539d00075b2793451, \< 716dceb19a9f8ff6c9d3aee5a771a93d6a47a0b6; \>= afd8d65411551839b7ab14a539d00075b2793451, \< 448db01a48e1cdbbc31c995716a5dac1e52ba036; \>= afd8d65411551839b7ab14a539d00075b2793451, \< 94797b84cb9985022eb9cb3275c9497fbc883bb6; \>= afd8d65411551839b7ab14a539d00075b2793451, \< 674b56aa57f9379854cb6798c3bbcef7e7b51ab7
- Anyone running Linux 3.15

## Description

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

net/9p: fix double req put in p9\_fd\_cancelled

Syzkaller reports a KASAN issue as below:

general protection fault, probably for non-canonical address 0xfbd59c0000000021: 0000 \[\#1\] PREEMPT SMP KASAN NOPTI
KASAN: maybe wild-memory-access in range \[0xdead000000000108-0xdead00000000010f\]
CPU: 0 PID: 5083 Comm: syz-executor.2 Not tainted 6.1.134-syzkaller-00037-g855bd1d7d838 \#0
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.12.0-1 04/01/2014
RIP: 0010:\_\_list\_del include/linux/list.h:114 \[inline\]
RIP: 0010:\_\_list\_del\_entry include/linux/list.h:137 \[inline\]
RIP: 0010:list\_del include/linux/list.h:148 \[inline\]
RIP: 0010:p9\_fd\_cancelled+0xe9/0x200 net/9p/trans\_fd.c:734

Call Trace:
 \<TASK\>
 p9\_client\_flush+0x351/0x440 net/9p/client.c:614
 p9\_client\_rpc+0xb6b/0xc70 net/9p/client.c:734
 p9\_client\_version net/9p/client.c:920 \[inline\]
 p9\_client\_create+0xb51/0x1240 net/9p/client.c:1027
 v9fs\_session\_init+0x1f0/0x18f0 fs/9p/v9fs.c:408
 v9fs\_mount+0xba/0xcb0 fs/9p/vfs\_super.c:126
 legacy\_get\_tree+0x108/0x220 fs/fs\_context.c:632
 vfs\_get\_tree+0x8e/0x300 fs/super.c:1573
 do\_new\_mount fs/namespace.c:3056 \[inline\]
 path\_mount+0x6a6/0x1e90 fs/namespace.c:3386
 do\_mount fs/namespace.c:3399 \[inline\]
 \_\_do\_sys\_mount fs/namespace.c:3607 \[inline\]
 \_\_se\_sys\_mount fs/namespace.c:3584 \[inline\]
 \_\_x64\_sys\_mount+0x283/0x300 fs/namespace.c:3584
 do\_syscall\_x64 arch/x86/entry/common.c:51 \[inline\]
 do\_syscall\_64+0x35/0x80 arch/x86/entry/common.c:81
 entry\_SYSCALL\_64\_after\_hwframe+0x6e/0xd8

This happens because of a race condition between:

- The 9p client sending an invalid flush request and later cleaning it up;
- The 9p client in p9\_read\_work() canceled all pending requests.

      Thread 1                              Thread 2
    ...
    p9\_client\_create()
    ...
    p9\_fd\_create()
    ...
    p9\_conn\_create()
    ...
    // start Thread 2
    INIT\_WORK(&m-\>rq, p9\_read\_work);
                                        p9\_read\_work()
    ...
    p9\_client\_rpc()
    ...
                                        ...
                                        p9\_conn\_cancel()
                                        ...
                                        spin\_lock(&m-\>req\_lock);
    ...
    p9\_fd\_cancelled()
    ...
                                        ...
                                        spin\_unlock(&m-\>req\_lock);
                                        // status rewrite
                                        p9\_client\_cb(m-\>client, req, REQ\_STATUS\_ERROR)
                                        // first remove
                                        list\_del(&req-\>req\_list);
                                        ...

    spin\_lock(&m-\>req\_lock)
    ...
    // second remove
    list\_del(&req-\>req\_list);
    spin\_unlock(&m-\>req\_lock)
  ...

Commit 74d6a5d56629 ("9p/trans\_fd: Fix concurrency del of req\_list in
p9\_fd\_cancelled/p9\_read\_work") fixes a concurrency issue in the 9p filesystem
client where the req\_list could be deleted simultaneously by both
p9\_read\_work and p9\_fd\_cancelled functions, but for the case where req-\>status
equals REQ\_STATUS\_RCVD.

Update the check for req-\>status in p9\_fd\_cancelled to skip processing not
just received requests, but anything that is not SENT, as whatever
changed the state from SENT also removed the request from its list.

Found by Linux Verification Center (linuxtesting.org) with Syzkaller.

\[updated the check from status == RECV \|\| status == ERROR to status != SENT\]

## Affected and fixed versions

- Linux: \>= afd8d65411551839b7ab14a539d00075b2793451, \< a5901a0dfb5964525990106706ae8b98db098226; \>= afd8d65411551839b7ab14a539d00075b2793451, \< 5c64c0b7b3446f7ed088a13bc8d7487d66534cbb; \>= afd8d65411551839b7ab14a539d00075b2793451, \< c1db864270eb7fea94a9ef201da0c9dc1cbab7b8; \>= afd8d65411551839b7ab14a539d00075b2793451, \< 0e0097005abc02c9f262370674f855625f4f3fb4; \>= afd8d65411551839b7ab14a539d00075b2793451, \< 284e67a93b8c48952b6fc82129a8d3eb9dc73b06; \>= afd8d65411551839b7ab14a539d00075b2793451, \< 716dceb19a9f8ff6c9d3aee5a771a93d6a47a0b6; \>= afd8d65411551839b7ab14a539d00075b2793451, \< 448db01a48e1cdbbc31c995716a5dac1e52ba036; \>= afd8d65411551839b7ab14a539d00075b2793451, \< 94797b84cb9985022eb9cb3275c9497fbc883bb6; \>= afd8d65411551839b7ab14a539d00075b2793451, \< 674b56aa57f9379854cb6798c3bbcef7e7b51ab7 (cvelist)
- Linux: 3.15 (cvelist)

## Mitigation

- Upgrade Linux to 674b56aa57f9379854cb6798c3bbcef7e7b51ab7 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2025-40027. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2025-40027.md
Affected: Linux >= afd8d65411551839b7ab14a539d00075b2793451, < a5901a0dfb5964525990106706ae8b98db098226; >= afd8d65411551839b7ab14a539d00075b2793451, < 5c64c0b7b3446f7ed088a13bc8d7487d66534cbb; >= afd8d65411551839b7ab14a539d00075b2793451, < c1db864270eb7fea94a9ef201da0c9dc1cbab7b8; >= afd8d65411551839b7ab14a…
Fixed in: Linux 5c64c0b7b3446f7ed088a13bc8d7487d66534cbb, Linux 0e0097005abc02c9f262370674f855625f4f3fb4, Linux 284e67a93b8c48952b6fc82129a8d3eb9dc73b06, Linux 716dceb19a9f8ff6c9d3aee5a771a93d6a47a0b6, Linux 448db01a48e1cdbbc31c995716a5dac1e52ba036, Linux 94797b84cb9985022eb9cb3275c9497fbc883bb6, Linux 674b5…

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2025-40027 being exploited?

There is no confirmed exploitation: CVE-2025-40027 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.25% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2025-40027?

High: CVSS 7.8 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2025-40027?

Linux \>= afd8d65411551839b7ab14a539d00075b2793451, \< a5901a0dfb5964525990106706ae8b98db098226; \>= afd8d65411551839b7ab14a539d00075b2793451, \< 5c64c0b7b3446f7ed088a13bc8d7487d66534cbb; \>= afd8d65411551839b7ab14a539d00075b2793451, \< c1db864270eb7fea94a9ef201da0c9dc1cbab7b8; \>= afd8d65411551839b7ab14a539d00075b2793451, \< 0e0097005abc02c9f262370674f855625f4f3fb4; \>= afd8d65411551839b7ab14a539d00075b2793451, \< 284e67a93b8c48952b6fc82129a8d3eb9dc73b06; \>= afd8d65411551839b7ab14a539d00075b2793451, \< 716dceb19a9f8ff6c9d3aee5a771a93d6a47a0b6; \>= afd8d65411551839b7ab14a539d00075b2793451, \< 448db01a48e1cdbbc31c995716a5dac1e52ba036; \>= afd8d65411551839b7ab14a539d00075b2793451, \< 94797b84cb9985022eb9cb3275c9497fbc883bb6; \>= afd8d65411551839b7ab14a539d00075b2793451, \< 674b56aa57f9379854cb6798c3bbcef7e7b51ab7; Linux 3.15.

### Is there a fix for CVE-2025-40027?

Yes. Fixed in Linux 5c64c0b7b3446f7ed088a13bc8d7487d66534cbb, Linux 0e0097005abc02c9f262370674f855625f4f3fb4, Linux 284e67a93b8c48952b6fc82129a8d3eb9dc73b06, Linux 716dceb19a9f8ff6c9d3aee5a771a93d6a47a0b6, Linux 448db01a48e1cdbbc31c995716a5dac1e52ba036, Linux 94797b84cb9985022eb9cb3275c9497fbc883bb6, Linux 674b56aa57f9379854cb6798c3bbcef7e7b51ab7. Upgrade Linux to 674b56aa57f9379854cb6798c3bbcef7e7b51ab7 or later.

### How do I check if I'm affected by CVE-2025-40027?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- other: <https://git.kernel.org/stable/c/a5901a0dfb5964525990106706ae8b98db098226>
- other: <https://git.kernel.org/stable/c/5c64c0b7b3446f7ed088a13bc8d7487d66534cbb>
- other: <https://git.kernel.org/stable/c/c1db864270eb7fea94a9ef201da0c9dc1cbab7b8>
- other: <https://git.kernel.org/stable/c/0e0097005abc02c9f262370674f855625f4f3fb4>
- other: <https://git.kernel.org/stable/c/284e67a93b8c48952b6fc82129a8d3eb9dc73b06>
- other: <https://git.kernel.org/stable/c/716dceb19a9f8ff6c9d3aee5a771a93d6a47a0b6>
- other: <https://git.kernel.org/stable/c/448db01a48e1cdbbc31c995716a5dac1e52ba036>
- other: <https://git.kernel.org/stable/c/94797b84cb9985022eb9cb3275c9497fbc883bb6>
- other: <https://git.kernel.org/stable/c/674b56aa57f9379854cb6798c3bbcef7e7b51ab7>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2025-40027>

HTML: <https://flawdb.com/CVE-2025-40027> · JSON: <https://flawdb.com/api/v1/entries/CVE-2025-40027>
