CVE-2025-40186

Source
https://nvd.nist.gov/vuln/detail/CVE-2025-40186
Import Source
https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2025-40186.json
JSON Data
https://api.test.osv.dev/v1/vulns/CVE-2025-40186
Downstream
Published
2025-11-12T21:56:29.033Z
Modified
2025-11-27T02:33:58.832225Z
Summary
tcp: Don't call reqsk_fastopen_remove() in tcp_conn_request().
Details

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

tcp: Don't call reqskfastopenremove() in tcpconnrequest().

syzbot reported the splat below in tcpconnrequest(). [0]

If a listener is close()d while a TFO socket is being processed in tcpconnrequest(), inetcskreqskqueueadd() does not set reqsk->sk and calls inetchildforget(), which calls tcp_disconnect() for the TFO socket.

After the cited commit, tcpdisconnect() calls reqskfastopenremove(), where reqskput() is called due to !reqsk->sk.

Then, reqskfastopenremove() in tcpconnrequest() decrements the last req->rskrefcnt and frees reqsk, and _reqskfree() at the dropand_free label causes the refcount underflow for the listener and double-free of the reqsk.

Let's remove reqskfastopenremove() in tcpconnrequest().

Note that other callers make sure tp->fastopen_rsk is not NULL.

WARNING: CPU: 12 PID: 5563 at lib/refcount.c:28 refcountwarnsaturate (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:refcountwarnsaturate (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> tcpconnrequest (./include/linux/refcount.h:400 ./include/linux/refcount.h:432 ./include/linux/refcount.h:450 ./include/net/sock.h:1965 ./include/net/requestsock.h:131 net/ipv4/tcpinput.c:7301) tcprcvstateprocess (net/ipv4/tcpinput.c:6708) tcpv6dorcv (net/ipv6/tcpipv6.c:1670) tcpv6rcv (net/ipv6/tcpipv6.c:1906) ip6protocoldeliverrcu (net/ipv6/ip6input.c:438) ip6input (net/ipv6/ip6input.c:500) ipv6rcv (net/ipv6/ip6input.c:311) _netifreceiveskb (net/core/dev.c:6104) processbacklog (net/core/dev.c:6456) _napipoll (net/core/dev.c:7506) netrxaction (net/core/dev.c:7569 net/core/dev.c:7696) handlesoftirqs (kernel/softirq.c:579) do_softirq (kernel/softirq.c:480) </IRQ>

Database specific
{
    "cna_assigner": "Linux",
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/blob/cc431b3424123d84bcd7afd4de150b33f117a8ef/cves/2025/40xxx/CVE-2025-40186.json"
}
References

Affected packages

Git / git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

Affected ranges

Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
7ec092a91ff351dcde89c23e795b73a328274db6
Fixed
e359b742eac1eac75cff4e38ee2e8cea492acd9b
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
a4378dedd6e07e62f2fccb17d78c9665718763d0
Fixed
ff6a8883f96a5bc74241ce5b3d431a6dcfa2124d
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
33a4fdf0b4a25f8ce65380c3b0136b407ca57609
Fixed
eb85ad5f23268d64b037bfb545cbcba3752f90c7
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
17d699727577814198d744d6afe54735c6b54c99
Fixed
643a94b0cf767325e953591c212be2eb826b9d7f
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
dfd06131107e7b699ef1e2a24ed2f7d17c917753
Fixed
422c1c173c39bbbae1e0eaaf8aefe40b2596233b
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
fa4749c065644af4db496b338452a69a3e5147d9
Fixed
c11ace909e873118295e9eb22dc8c58b0b50eb32
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
45c8a6cc2bcd780e634a6ba8e46bffbdf1fc5c01
Fixed
64dc47a13aa3d9daf7cec29b44dca8e22a6aea15
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
45c8a6cc2bcd780e634a6ba8e46bffbdf1fc5c01
Fixed
2e7cbbbe3d61c63606994b7ff73c72537afe2e1c
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
0 Unknown introduced commit / All previous commits are affected
Last affected
ae313d14b45eca7a6bb29cb9bf396d977e7d28fb

Linux / Kernel

Package

Name
Kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
5.4.301
Type
ECOSYSTEM
Events
Introduced
5.5.0
Fixed
5.10.246
Type
ECOSYSTEM
Events
Introduced
5.11.0
Fixed
5.15.195
Type
ECOSYSTEM
Events
Introduced
5.16.0
Fixed
6.1.157
Type
ECOSYSTEM
Events
Introduced
6.2.0
Fixed
6.6.113
Type
ECOSYSTEM
Events
Introduced
6.7.0
Fixed
6.12.54
Type
ECOSYSTEM
Events
Introduced
6.13.0
Fixed
6.17.4