VYPR
Unrated severityNVD Advisory· Published Dec 4, 2025· Updated Apr 15, 2026

CVE-2025-40258

CVE-2025-40258

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:

__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

AI Insight

LLM-synthesized narrative grounded in this CVE's description and references.

A race condition in the Linux kernel's MPTCP subsystem can cause a use-after-free when scheduling work, potentially leading to system compromise.

Vulnerability

Overview

CVE-2025-40258 is a race condition vulnerability in the Linux kernel's Multipath TCP (MPTCP) implementation, specifically in the mptcp_schedule_work(). The root cause is an incorrect ordering of operations: the function schedules a work item and then increments the socket's reference count (sock_hold()) only if the work was successfully scheduled. However, because the scheduled work (mptcp_worker()) can execute and complete immediately on another CPU before the reference count is incremented, the socket may be freed in question may have already been freed, leading to a use-after-free condition [1][2][3].

Exploitation

An attacker can trigger this vulnerability by sending specially crafted network traffic that causes the MPTCP subsystem to schedule work via mptcp_schedule_work(), for example through the MPTCP timeout timer (mptcp_tout_timer). The race window is small but can be reliably hit by an attacker with the ability to send network packets to a vulnerable system. No authentication is required, as the attack is network-based and targets the kernel's network stack [1].

Impact

Successful exploitation of this race condition can result in a use-after-free of kernel socket objects. This can lead to system crashes (denial of service) or, in more severe cases, arbitrary code execution in the kernel context, allowing an attacker to fully compromise the system. The vulnerability is rated with a CVSS score of 7.8 (High), reflecting the potential for high impact on confidentiality, integrity, and availability [1][2][3].

Mitigation

The fix, which reorders the operations to increment the reference count before scheduling the work, has been applied to the Linux kernel stable branches. Users are advised to update their kernels to versions containing the commit 035bca3fca3f017ee9dea3a5a756e77a6f7138cc6eea or later. No workaround is available; patching is the only mitigation [1][2][3].

AI Insight generated on May 19, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.

Affected products

2
  • Linux/Kernelinferred2 versions
    (expand)+ 1 more
    • (no CPE)
    • (no CPE)

Patches

7

Vulnerability mechanics

Generated on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.

References

7

News mentions

0

No linked articles in our index yet.