# CVE-2025-40186: tcp: Don't call reqsk\_fastopen\_remove() in tcp\_conn\_request().

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

- **Severity:** HIGH 8.1
- **CVSS:** 8.1 (v3.1, CNA) `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Network; Attack complexity: High; Privileges required: None; 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:** Remote, no login needed
- **EPSS:** 0.82% (percentile 54, 2026-11-26)
- **Published:** 2025-11-12T21:56:29.033Z
- **Modified:** 2026-10-19T21:10:00.160Z

## Who should check

- Anyone running Linux \>= 7ec092a91ff351dcde89c23e795b73a328274db6, \< e359b742eac1eac75cff4e38ee2e8cea492acd9b; \>= a4378dedd6e07e62f2fccb17d78c9665718763d0, \< ff6a8883f96a5bc74241ce5b3d431a6dcfa2124d; \>= 33a4fdf0b4a25f8ce65380c3b0136b407ca57609, \< eb85ad5f23268d64b037bfb545cbcba3752f90c7; \>= 17d699727577814198d744d6afe54735c6b54c99, \< 643a94b0cf767325e953591c212be2eb826b9d7f; \>= dfd06131107e7b699ef1e2a24ed2f7d17c917753, \< 422c1c173c39bbbae1e0eaaf8aefe40b2596233b; \>= fa4749c065644af4db496b338452a69a3e5147d9, \< c11ace909e873118295e9eb22dc8c58b0b50eb32; \>= 45c8a6cc2bcd780e634a6ba8e46bffbdf1fc5c01, \< 64dc47a13aa3d9daf7cec29b44dca8e22a6aea15; \>= 45c8a6cc2bcd780e634a6ba8e46bffbdf1fc5c01, \< 2e7cbbbe3d61c63606994b7ff73c72537afe2e1c; ae313d14b45eca7a6bb29cb9bf396d977e7d28fb; \>= 5.4.300, \< 5.4.301; …
- Anyone running Linux 6.17

## Description

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

tcp: Don't call reqsk\_fastopen\_remove() in tcp\_conn\_request().

syzbot reported the splat below in tcp\_conn\_request(). \[0\]

If a listener is close()d while a TFO socket is being processed in
tcp\_conn\_request(), inet\_csk\_reqsk\_queue\_add() does not set reqsk-\>sk
and calls inet\_child\_forget(), which calls tcp\_disconnect() for the
TFO socket.

After the cited commit, tcp\_disconnect() calls reqsk\_fastopen\_remove(),
where reqsk\_put() is called due to !reqsk-\>sk.

Then, reqsk\_fastopen\_remove() in tcp\_conn\_request() decrements the
last req-\>rsk\_refcnt and frees reqsk, and \_\_reqsk\_free() at the
drop\_and\_free label causes the refcount underflow for the listener
and double-free of the reqsk.

Let's remove reqsk\_fastopen\_remove() in tcp\_conn\_request().

Note that other callers make sure tp-\>fastopen\_rsk is not NULL.

\[0\]:
refcount\_t: underflow; use-after-free.
WARNING: CPU: 12 PID: 5563 at lib/refcount.c:28 refcount\_warn\_saturate (lib/refcount.c:28)
Modules linked in:
CPU: 12 UID: 0 PID: 5563 Comm: syz-executor Not tainted syzkaller \#0 PREEMPT(full)
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025
RIP: 0010:refcount\_warn\_saturate (lib/refcount.c:28)
Code: ab e8 8e b4 98 ff 0f 0b c3 cc cc cc cc cc 80 3d a4 e4 d6 01 00 75 9c c6 05 9b e4 d6 01 01 48 c7 c7 e8 df fb ab e8 6a b4 98 ff \<0f\> 0b e9 03 5b 76 00 cc 80 3d 7d e4 d6 01 00 0f 85 74 ff ff ff c6
RSP: 0018:ffffa79fc0304a98 EFLAGS: 00010246
RAX: d83af4db1c6b3900 RBX: ffff9f65c7a69020 RCX: d83af4db1c6b3900
RDX: 0000000000000000 RSI: 00000000ffff7fff RDI: ffffffffac78a280
RBP: 000000009d781b60 R08: 0000000000007fff R09: ffffffffac6ca280
R10: 0000000000017ffd R11: 0000000000000004 R12: ffff9f65c7b4f100
R13: ffff9f65c7d23c00 R14: ffff9f65c7d26000 R15: ffff9f65c7a64ef8
FS:  00007f9f962176c0(0000) GS:ffff9f65fcf00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000200000000180 CR3: 000000000dbbe006 CR4: 0000000000372ef0
Call Trace:
 \<IRQ\>
 tcp\_conn\_request (./include/linux/refcount.h:400 ./include/linux/refcount.h:432 ./include/linux/refcount.h:450 ./include/net/sock.h:1965 ./include/net/request\_sock.h:131 net/ipv4/tcp\_input.c:7301)
 tcp\_rcv\_state\_process (net/ipv4/tcp\_input.c:6708)
 tcp\_v6\_do\_rcv (net/ipv6/tcp\_ipv6.c:1670)
 tcp\_v6\_rcv (net/ipv6/tcp\_ipv6.c:1906)
 ip6\_protocol\_deliver\_rcu (net/ipv6/ip6\_input.c:438)
 ip6\_input (net/ipv6/ip6\_input.c:500)
 ipv6\_rcv (net/ipv6/ip6\_input.c:311)
 \_\_netif\_receive\_skb (net/core/dev.c:6104)
 process\_backlog (net/core/dev.c:6456)
 \_\_napi\_poll (net/core/dev.c:7506)
 net\_rx\_action (net/core/dev.c:7569 net/core/dev.c:7696)
 handle\_softirqs (kernel/softirq.c:579)
 do\_softirq (kernel/softirq.c:480)
 \</IRQ\>

## Affected and fixed versions

- Linux: \>= 7ec092a91ff351dcde89c23e795b73a328274db6, \< e359b742eac1eac75cff4e38ee2e8cea492acd9b; \>= a4378dedd6e07e62f2fccb17d78c9665718763d0, \< ff6a8883f96a5bc74241ce5b3d431a6dcfa2124d; \>= 33a4fdf0b4a25f8ce65380c3b0136b407ca57609, \< eb85ad5f23268d64b037bfb545cbcba3752f90c7; \>= 17d699727577814198d744d6afe54735c6b54c99, \< 643a94b0cf767325e953591c212be2eb826b9d7f; \>= dfd06131107e7b699ef1e2a24ed2f7d17c917753, \< 422c1c173c39bbbae1e0eaaf8aefe40b2596233b; \>= fa4749c065644af4db496b338452a69a3e5147d9, \< c11ace909e873118295e9eb22dc8c58b0b50eb32; \>= 45c8a6cc2bcd780e634a6ba8e46bffbdf1fc5c01, \< 64dc47a13aa3d9daf7cec29b44dca8e22a6aea15; \>= 45c8a6cc2bcd780e634a6ba8e46bffbdf1fc5c01, \< 2e7cbbbe3d61c63606994b7ff73c72537afe2e1c; ae313d14b45eca7a6bb29cb9bf396d977e7d28fb; \>= 5.4.300, \< 5.4.301; … (cvelist)
- Linux: 6.17 (cvelist)

## Mitigation

- No fix listed yet: follow the vendor advisory.

## Check your systems with an agent

Paste this into a coding agent:

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

Details: https://flawdb.com/CVE-2025-40186.md
Affected: Linux >= 7ec092a91ff351dcde89c23e795b73a328274db6, < e359b742eac1eac75cff4e38ee2e8cea492acd9b; >= a4378dedd6e07e62f2fccb17d78c9665718763d0, < ff6a8883f96a5bc74241ce5b3d431a6dcfa2124d; >= 33a4fdf0b4a25f8ce65380c3b0136b407ca57609, < eb85ad5f23268d64b037bfb545cbcba3752f90c7; >= 17d699727577814198d744d…
Fixed in: Linux 643a94b0cf767325e953591c212be2eb826b9d7f, Linux 422c1c173c39bbbae1e0eaaf8aefe40b2596233b, Linux 64dc47a13aa3d9daf7cec29b44dca8e22a6aea15, Linux 2e7cbbbe3d61c63606994b7ff73c72537afe2e1c, Linux 5.4.301

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-40186 being exploited?

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

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

High: CVSS 8.1 (v3.1, scored by CNA). Remote, no login needed. The attack needs conditions outside the attacker's control, which makes it harder.

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

Linux \>= 7ec092a91ff351dcde89c23e795b73a328274db6, \< e359b742eac1eac75cff4e38ee2e8cea492acd9b; \>= a4378dedd6e07e62f2fccb17d78c9665718763d0, \< ff6a8883f96a5bc74241ce5b3d431a6dcfa2124d; \>= 33a4fdf0b4a25f8ce65380c3b0136b407ca57609, \< eb85ad5f23268d64b037bfb545cbcba3752f90c7; \>= 17d699727577814198d744d6afe54735c6b54c99, \< 643a94b0cf767325e953591c212be2eb826b9d7f; \>= dfd06131107e7b699ef1e2a24ed2f7d17c917753, \< 422c1c173c39bbbae1e0eaaf8aefe40b2596233b; \>= fa4749c065644af4db496b338452a69a3e5147d9, \< c11ace909e873118295e9eb22dc8c58b0b50eb32; \>= 45c8a6cc2bcd780e634a6ba8e46bffbdf1fc5c01, \< 64dc47a13aa3d9daf7cec29b44dca8e22a6aea15; \>= 45c8a6cc2bcd780e634a6ba8e46bffbdf1fc5c01, \< 2e7cbbbe3d61c63606994b7ff73c72537afe2e1c; ae313d14b45eca7a6bb29cb9bf396d977e7d28fb; \>= 5.4.300, \< 5.4.301; …; Linux 6.17.

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

Yes. Fixed in Linux 643a94b0cf767325e953591c212be2eb826b9d7f, Linux 422c1c173c39bbbae1e0eaaf8aefe40b2596233b, Linux 64dc47a13aa3d9daf7cec29b44dca8e22a6aea15, Linux 2e7cbbbe3d61c63606994b7ff73c72537afe2e1c, Linux 5.4.301. No fix listed yet: follow the vendor advisory.

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

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/e359b742eac1eac75cff4e38ee2e8cea492acd9b>
- other: <https://git.kernel.org/stable/c/ff6a8883f96a5bc74241ce5b3d431a6dcfa2124d>
- other: <https://git.kernel.org/stable/c/eb85ad5f23268d64b037bfb545cbcba3752f90c7>
- other: <https://git.kernel.org/stable/c/643a94b0cf767325e953591c212be2eb826b9d7f>
- other: <https://git.kernel.org/stable/c/422c1c173c39bbbae1e0eaaf8aefe40b2596233b>
- other: <https://git.kernel.org/stable/c/c11ace909e873118295e9eb22dc8c58b0b50eb32>
- other: <https://git.kernel.org/stable/c/64dc47a13aa3d9daf7cec29b44dca8e22a6aea15>
- other: <https://git.kernel.org/stable/c/2e7cbbbe3d61c63606994b7ff73c72537afe2e1c>

## 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-40186>

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