CVE-2025-40186: tcp: Don't call reqsk_fastopen_remove() in tcp_conn_request().

Published Nov 12, 2025
·
Updated

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 tcpdisconnect() 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 dropandfree 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->fastopenrsk is not NULL.

[0]: refcountt: underflow; use-after-free. 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) dosoftirq (kernel/softirq.c:480) </IRQ>

Affected Software

8 affected componentsFixes available
Linux Linux kernel
linux/kernel<5.4.301
5.4.301
linux/kernel>=5.5.0<5.10.246
5.10.246
linux/kernel>=5.11.0<5.15.195
5.15.195
linux/kernel>=5.16.0<6.1.157
6.1.157
linux/kernel>=6.2.0<6.6.113
6.6.113
linux/kernel>=6.7.0<6.12.54
6.12.54
linux/kernel>=6.13.0<6.17.4
6.17.4

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade linux/Kernel to a version that resolves this vulnerability.

    Fixed in 5.4.301
  2. Upgrade

    Upgrade linux/Kernel to a version that resolves this vulnerability.

    Fixed in 5.10.246
  3. Upgrade

    Upgrade linux/Kernel to a version that resolves this vulnerability.

    Fixed in 5.15.195
  4. Upgrade

    Upgrade linux/Kernel to a version that resolves this vulnerability.

    Fixed in 6.1.157
  5. Upgrade

    Upgrade linux/Kernel to a version that resolves this vulnerability.

    Fixed in 6.6.113
  6. Upgrade

    Upgrade linux/Kernel to a version that resolves this vulnerability.

    Fixed in 6.12.54
  7. Upgrade

    Upgrade linux/Kernel to a version that resolves this vulnerability.

    Fixed in 6.17.4
  8. Configuration

    Apply the resolved change: do not call reqsk_fastopen_remove() in tcp_conn_request(), so that closing a listener while a TFO socket is being processed does not trigger reqsk double-free/use-after-free via refcount underflow.

    Linux kernel TCP Fast Open (TFO) handling reqsk_fastopen_remove() invocation in tcp_conn_request() = removed

Event History

Nov 12, 2025
CVE Published
via MITRE·09:56 PM
Data Sourced
via MITRE·09:56 PM
DescriptionSeverity
Data Sourced
via OSV·09:56 PM
DescriptionSeverityAffected Software
Data Sourced
via NVD·10:15 PM
DescriptionSeverity
Data Sourced
via Red Hat·11:02 PM
DescriptionSeverityAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2025-40186?

CVE-2025-40186 has a high severity due to potential denial of service issues in the Linux kernel.

2

How do I fix CVE-2025-40186?

To fix CVE-2025-40186, update to the latest version of the Linux kernel where the vulnerability has been patched.

3

Which versions of the Linux kernel are affected by CVE-2025-40186?

CVE-2025-40186 affects all versions of the Linux kernel that are prior to the security patch release.

4

What impact does CVE-2025-40186 have on system stability?

CVE-2025-40186 can lead to system instability by causing kernel crashes when a listener socket is closed improperly.

5

Is CVE-2025-40186 being actively exploited?

At this time, there are no known active exploits for CVE-2025-40186, but it is essential to apply patches promptly.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203