CVE-2025-40258: mptcp: fix race condition in mptcp_schedule_work()

Published Dec 4, 2025
·
Updated

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

mptcp: fix race condition in mptcpschedulework()

syzbot reported use-after-free in mptcpschedulework() [1]

Issue here is that mptcpschedulework() schedules a work, then gets a refcount on sk->skrefcnt if the work was scheduled. This refcount will be released by mptcpworker().

[A] if (schedulework(...)) { [B] sockhold(sk); return true; }

Problem is that mptcpworker() can run immediately and complete before [B]

We need instead :

sockhold(sk); if (schedulework(...)) return true; sockput(sk);

[1] refcountt: addition on 0; use-after-free. WARNING: CPU: 1 PID: 29 at lib/refcount.c:25 refcountwarnsaturate+0xfa/0x1d0 lib/refcount.c:25 Call Trace: <TASK> refcountadd include/linux/refcount.h:-1 [inline] refcountinc include/linux/refcount.h:366 [inline] refcountinc include/linux/refcount.h:383 [inline] sockhold include/net/sock.h:816 [inline] mptcpschedulework+0x164/0x1a0 net/mptcp/protocol.c:943 mptcptouttimer+0x21/0xa0 net/mptcp/protocol.c:2316 calltimerfn+0x17e/0x5f0 kernel/time/timer.c:1747 expiretimers kernel/time/timer.c:1798 [inline] runtimers kernel/time/timer.c:2372 [inline] runtimerbase+0x648/0x970 kernel/time/timer.c:2384 runtimerbase kernel/time/timer.c:2393 [inline] runtimersoftirq+0xb7/0x180 kernel/time/timer.c:2403 handlesoftirqs+0x22f/0x710 kernel/softirq.c:622 dosoftirq kernel/softirq.c:656 [inline] runktimerd+0xcf/0x190 kernel/softirq.c:1138 smpbootthreadfn+0x542/0xa60 kernel/smpboot.c:160 kthread+0x711/0x8a0 kernel/kthread.c:463 retfromfork+0x4bc/0x870 arch/x86/kernel/process.c:158 retfromforkasm+0x1a/0x30 arch/x86/entry/entry64.S:245

Other sources

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

mptcp: fix race condition in mptcpschedulework()

syzbot reported use-after-free in mptcpschedulework() [1]

Issue here is that mptcpschedulework() schedules a work, then gets a refcount on sk-skrefcnt if the work was scheduled. This refcount will be released by mptcpworker().

[A] if (schedulework(...)) { [B] sockhold(sk); return true; }

Problem is that mptcpworker() can run immediately and complete before [B]

We need instead :

sockhold(sk); if (schedulework(...)) return true; sockput(sk);

[1] refcountt: addition on 0; use-after-free. WARNING: CPU: 1 PID: 29 at lib/refcount.c:25 refcountwarnsaturate+0xfa/0x1d0 lib/refcount.c:25 Call Trace: TASK refcountadd include/linux/refcount.h:-1 [inline] refcountinc include/linux/refcount.h:366 [inline] refcountinc include/linux/refcount.h:383 [inline] sockhold include/net/sock.h:816 [inline] mptcpschedulework+0x164/0x1a0 net/mptcp/protocol.c:943 mptcptouttimer+0x21/0xa0 net/mptcp/protocol.c:2316 calltimerfn+0x17e/0x5f0 kernel/time/timer.c:1747 expiretimers kernel/time/timer.c:1798 [inline] runtimers kernel/time/timer.c:2372 [inline] runtimerbase+0x648/0x970 kernel/time/timer.c:2384 runtimerbase kernel/time/timer.c:2393 [inline] runtimersoftirq+0xb7/0x180 kernel/time/timer.c:2403 handlesoftirqs+0x22f/0x710 kernel/softirq.c:622 dosoftirq kernel/softirq.c:656 [inline] runktimerd+0xcf/0x190 kernel/softirq.c:1138 smpbootthreadfn+0x542/0xa60 kernel/smpboot.c:160 kthread+0x711/0x8a0 kernel/kthread.c:463 retfromfork+0x4bc/0x870 arch/x86/kernel/process.c:158 retfromforkasm+0x1a/0x30 arch/x86/entry/entry64.S:245

IBM

Affected Software

8 affected componentsFixes available
Linux Linux kernel
Microsoft azl3 kernel 6.6.112.1-2
Microsoft azl3 kernel 6.6.117.1-1
Microsoft azl3 kernel 6.6.117.1-1
IBM Verify Identity Access<=11.0 - 11.0.2
IBM Security Verify Access<=10.0 - 10.0.9.1
IBM Verify Identity Access Container<=11.0 - 11.0.2
IBM Security Verify Access Container<=10.0 - 10.0.9.1

Event History

Dec 4, 2025
CVE Published
via MITRE·04:08 PM
Data Sourced
via MITRE·04:08 PM
Description
Data Sourced
via NVD·04:16 PM
Description
Data Sourced
via Red Hat·05:02 PM
DescriptionSeverityAffected Software
Dec 6, 2025
Data Sourced
via Microsoft·01:02 AM
DescriptionSeverityWeaknessAffected Software
Updated
via Microsoft·01:02 AM
Affected Software
Updated
via Microsoft·01:02 AM
DescriptionSeverity
Jul 8, 2026
Data Sourced
via IBM·12:00 AM
DescriptionAffected Software

Parent advisories

This vulnerability appears in the following advisories.

Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2025-40258?

CVE-2025-40258 has a medium severity rating due to its potential for exploitation via a race condition.

2

How do I fix CVE-2025-40258?

To fix CVE-2025-40258, update the Linux kernel to the latest version where the vulnerability has been addressed.

3

What impact does CVE-2025-40258 have on system security?

CVE-2025-40258 can lead to a use-after-free condition, potentially allowing for remote code execution.

4

Is CVE-2025-40258 specific to certain Linux kernel versions?

CVE-2025-40258 affects multiple versions of the Linux kernel, so it is crucial to check if your version is vulnerable.

5

How was CVE-2025-40258 discovered?

CVE-2025-40258 was reported by syzbot, which revealed a use-after-free in the mptcp_schedule_work() function.

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