# CVE-2025-40258: mptcp: fix race condition in mptcp\_schedule\_work()

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

- **Severity:** CRITICAL 9.8
- **CVSS:** 9.8 (v3.1, CNA) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Network; Attack complexity: Low; 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.97% (percentile 61, 2026-11-26)
- **Published:** 2025-12-04T16:08:19.176Z
- **Modified:** 2026-10-19T21:10:00.160Z

## Who should check

- Anyone running Linux \>= 3b1d6210a9577369103330b0d802b0bf74b65e7f, \< f865e6595acf33083168db76921e66ace8bf0e5b; \>= 3b1d6210a9577369103330b0d802b0bf74b65e7f, \< 99908e2d601236842d705d5fd04fb349577316f5; \>= 3b1d6210a9577369103330b0d802b0bf74b65e7f, \< db4f7968a75250ca6c4ed70d0a78beabb2dcee18; \>= 3b1d6210a9577369103330b0d802b0bf74b65e7f, \< 8f9ba1a99a89feef9b5867c15a0141a97e893309; \>= 3b1d6210a9577369103330b0d802b0bf74b65e7f, \< ac28dfddedf6f209190950fc71bcff65ec4ab47b; \>= 3b1d6210a9577369103330b0d802b0bf74b65e7f, \< 3fc7723ed01d1130d4bf7063c50e0af60ecccbb4; \>= 3b1d6210a9577369103330b0d802b0bf74b65e7f, \< 035bca3f017ee9dea3a5a756e77a6f7138cc6eea
- Anyone running Linux 5.7

## Description

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

mptcp: fix race condition in mptcp\_schedule\_work()

syzbot reported use-after-free in mptcp\_schedule\_work() \[1\]

Issue here is that mptcp\_schedule\_work() schedules a work,
then gets a refcount on sk-\>sk\_refcnt if the work was scheduled.
This refcount will be released by mptcp\_worker().

\[A\] if (schedule\_work(...)) {
\[B\]     sock\_hold(sk);
        return true;
    }

Problem is that mptcp\_worker() can run immediately and complete before \[B\]

We need instead :

    sock\_hold(sk);
    if (schedule\_work(...))
        return true;
    sock\_put(sk);

\[1\]
refcount\_t: addition on 0; use-after-free.
 WARNING: CPU: 1 PID: 29 at lib/refcount.c:25 refcount\_warn\_saturate+0xfa/0x1d0 lib/refcount.c:25
Call Trace:
 \<TASK\>
 \_\_refcount\_add include/linux/refcount.h:-1 \[inline\]
  \_\_refcount\_inc include/linux/refcount.h:366 \[inline\]
  refcount\_inc include/linux/refcount.h:383 \[inline\]
  sock\_hold include/net/sock.h:816 \[inline\]
  mptcp\_schedule\_work+0x164/0x1a0 net/mptcp/protocol.c:943
  mptcp\_tout\_timer+0x21/0xa0 net/mptcp/protocol.c:2316
  call\_timer\_fn+0x17e/0x5f0 kernel/time/timer.c:1747
  expire\_timers kernel/time/timer.c:1798 \[inline\]
  \_\_run\_timers kernel/time/timer.c:2372 \[inline\]
  \_\_run\_timer\_base+0x648/0x970 kernel/time/timer.c:2384
  run\_timer\_base kernel/time/timer.c:2393 \[inline\]
  run\_timer\_softirq+0xb7/0x180 kernel/time/timer.c:2403
  handle\_softirqs+0x22f/0x710 kernel/softirq.c:622
  \_\_do\_softirq kernel/softirq.c:656 \[inline\]
  run\_ktimerd+0xcf/0x190 kernel/softirq.c:1138
  smpboot\_thread\_fn+0x542/0xa60 kernel/smpboot.c:160
  kthread+0x711/0x8a0 kernel/kthread.c:463
  ret\_from\_fork+0x4bc/0x870 arch/x86/kernel/process.c:158
  ret\_from\_fork\_asm+0x1a/0x30 arch/x86/entry/entry\_64.S:245

## Affected and fixed versions

- Linux: \>= 3b1d6210a9577369103330b0d802b0bf74b65e7f, \< f865e6595acf33083168db76921e66ace8bf0e5b; \>= 3b1d6210a9577369103330b0d802b0bf74b65e7f, \< 99908e2d601236842d705d5fd04fb349577316f5; \>= 3b1d6210a9577369103330b0d802b0bf74b65e7f, \< db4f7968a75250ca6c4ed70d0a78beabb2dcee18; \>= 3b1d6210a9577369103330b0d802b0bf74b65e7f, \< 8f9ba1a99a89feef9b5867c15a0141a97e893309; \>= 3b1d6210a9577369103330b0d802b0bf74b65e7f, \< ac28dfddedf6f209190950fc71bcff65ec4ab47b; \>= 3b1d6210a9577369103330b0d802b0bf74b65e7f, \< 3fc7723ed01d1130d4bf7063c50e0af60ecccbb4; \>= 3b1d6210a9577369103330b0d802b0bf74b65e7f, \< 035bca3f017ee9dea3a5a756e77a6f7138cc6eea (cvelist)
- Linux: 5.7 (cvelist)

## Mitigation

- Upgrade Linux to 035bca3f017ee9dea3a5a756e77a6f7138cc6eea 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-40258. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2025-40258.md
Affected: Linux >= 3b1d6210a9577369103330b0d802b0bf74b65e7f, < f865e6595acf33083168db76921e66ace8bf0e5b; >= 3b1d6210a9577369103330b0d802b0bf74b65e7f, < 99908e2d601236842d705d5fd04fb349577316f5; >= 3b1d6210a9577369103330b0d802b0bf74b65e7f, < db4f7968a75250ca6c4ed70d0a78beabb2dcee18; >= 3b1d6210a9577369103330b…
Fixed in: Linux 99908e2d601236842d705d5fd04fb349577316f5, Linux 8f9ba1a99a89feef9b5867c15a0141a97e893309, Linux 3fc7723ed01d1130d4bf7063c50e0af60ecccbb4, Linux 035bca3f017ee9dea3a5a756e77a6f7138cc6eea

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

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

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

Critical: CVSS 9.8 (v3.1, scored by CNA). Remote, no login needed.

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

Linux \>= 3b1d6210a9577369103330b0d802b0bf74b65e7f, \< f865e6595acf33083168db76921e66ace8bf0e5b; \>= 3b1d6210a9577369103330b0d802b0bf74b65e7f, \< 99908e2d601236842d705d5fd04fb349577316f5; \>= 3b1d6210a9577369103330b0d802b0bf74b65e7f, \< db4f7968a75250ca6c4ed70d0a78beabb2dcee18; \>= 3b1d6210a9577369103330b0d802b0bf74b65e7f, \< 8f9ba1a99a89feef9b5867c15a0141a97e893309; \>= 3b1d6210a9577369103330b0d802b0bf74b65e7f, \< ac28dfddedf6f209190950fc71bcff65ec4ab47b; \>= 3b1d6210a9577369103330b0d802b0bf74b65e7f, \< 3fc7723ed01d1130d4bf7063c50e0af60ecccbb4; \>= 3b1d6210a9577369103330b0d802b0bf74b65e7f, \< 035bca3f017ee9dea3a5a756e77a6f7138cc6eea; Linux 5.7.

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

Yes. Fixed in Linux 99908e2d601236842d705d5fd04fb349577316f5, Linux 8f9ba1a99a89feef9b5867c15a0141a97e893309, Linux 3fc7723ed01d1130d4bf7063c50e0af60ecccbb4, Linux 035bca3f017ee9dea3a5a756e77a6f7138cc6eea. Upgrade Linux to 035bca3f017ee9dea3a5a756e77a6f7138cc6eea or later.

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

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/f865e6595acf33083168db76921e66ace8bf0e5b>
- other: <https://git.kernel.org/stable/c/99908e2d601236842d705d5fd04fb349577316f5>
- other: <https://git.kernel.org/stable/c/db4f7968a75250ca6c4ed70d0a78beabb2dcee18>
- other: <https://git.kernel.org/stable/c/8f9ba1a99a89feef9b5867c15a0141a97e893309>
- other: <https://git.kernel.org/stable/c/ac28dfddedf6f209190950fc71bcff65ec4ab47b>
- other: <https://git.kernel.org/stable/c/3fc7723ed01d1130d4bf7063c50e0af60ecccbb4>
- other: <https://git.kernel.org/stable/c/035bca3f017ee9dea3a5a756e77a6f7138cc6eea>
- other: <https://cert-portal.siemens.com/productcert/html/ssa-253495.html>

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

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