From mboxrd@z Thu Jan 1 00:00:00 1970 From: AL-KERNEL To: kernel-cve@kernelcve.org Subject: [CVE-2025-40258][MODERATE 7.0] mptcp: fix race condition in mptcp_schedule_work() Date: Tue, 01 Dec 2026 11:26:34 -0400 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-AL-KERNEL-CVE: CVE-2025-40258 X-AL-KERNEL-Priority: MODERATE 7.0 X-AL-KERNEL-Severity: MODERATE 7.0 X-AL-KERNEL-Base-Severity: MODERATE X-AL-KERNEL-KPANIC: YES X-AL-KERNEL-ActionableScore: 5 X-AL-KERNEL-ActionableScore-Lower: unknown X-AL-KERNEL-Commit: 8f9ba1a99a89feef9b5867c15a0141a97e893309 List-Id: CVE: CVE-2025-40258 Priority: MODERATE 7.0 AL-KERNEL base severity: MODERATE KPANIC flag: YES Patch: mptcp: fix race condition in mptcp_schedule_work() Commit: 8f9ba1a99a89feef9b5867c15a0141a97e893309 Upstream patch: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=8f9ba1a99a89feef9b5867c15a0141a97e893309 Original CVE announcement: https://lore.kernel.org/linux-cve-announce/?q=CVE-2025-40258 Analysis date: Tue, 01 Dec 2026 11:26:34 -0400 ActionableScore: 5 ActionableScore lower bound: unknown Actionable bucket: Actionable Moderate / Strong Important candidate requiring manual review Manual review required: YES Summary: An unprivileged local MPTCP socket race can free the socket before `sock_hold()` performs a stale refcount write, causing a real UAF and possible kernel crash or reused-object corruption. ====================================================================== ABOUT THIS REPORT ====================================================================== The original Linux kernel CVE announcement for CVE-2025-40258 is available here: https://lore.kernel.org/linux-cve-announce/?q=CVE-2025-40258 The original announcement does not normally provide a security severity estimate, CVSS assessment, or enough information to determine whether the reported kernel bug represents a practically relevant security issue. This report was generated by AL-KERNEL, an AI-assisted Linux kernel vulnerability analysis system developed by Alexander Larkin. It combines an autonomous classifier with LLM-assisted technical analysis and a separate ActionableScore mechanism. The purpose of this report is to prioritize Linux kernel CVEs before manual review, identify cases that require prompt investigation, and support automatic closure of issues that are unlikely to have meaningful security impact. Published priority for this report: MODERATE 7.0 Manual review required: YES A detailed explanation of the methodology and priority rules is included at the end of this message. ====================================================================== AL-KERNEL CLASSIFICATION RESULT ====================================================================== CVE-2025-40258 MODERATE https://www.kernelcve.org/list/?q=CVE-2025-40258 CHECK WITH IMPACT FROM ORIG NN IMPORTANT | AEGIS IMPACT MODERATE_KPANIC AEGIS_AS=5 LEGACY=MODERATE_KPANIC RESULT=SAME (final reconciliation agrees; DECISION: both MODERATE_KPANIC) Maybe valid. Check manually. Hints by AL-KERNEL: The best (paranoid) CVSS is 'AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H';*CWE-416;CWE-362;CWE-911;Other CVSS 'AV:L/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:H';BEST CVSS score: '8.1';DESCR 'An MPTCP socket lifetime race occurs because mptcp_schedule_work schedules the worker before acquiring the socket reference that the worker later releases. The worker can complete first and drop the final reference, after which sock_hold increments sk_refcnt in freed or potentially reused memory. This provides a concrete use after free write through the stale refcount field, although refcount hardening and the fixed write value may constrain exploitation. For the CVSS the PR:N value in the paranoid vector assumes that a remote MPTCP peer can control packet timing, retransmission timeout behavior, and connection teardown without privileges on the target. The base vector uses PR:L and AV:L because reliable reproduction is more clearly supported for an unprivileged local process controlling its own MPTCP socket. Availability impact includes a kernel crash. Confidentiality and integrity impact may become significant if the freed socket memory is reused before the stale refcount operation, but a stable arbitrary read or arbitrary write primitive is not demonstrated. Automated impact decision path. The original SimpleNet classifier selected IMPORTANT. The primary LLM estimated paranoid CVSS 8.1 and the production ActionableScore returned 5 with recommendation Actionable Moderate / Strong Important candidate requiring manual review. The production rules then evaluated CVSS thresholds and ActionableScore thresholds. Recorded rule transitions were KP and FD specialist checks stage IMPORTANT to MODERATE_KPANIC because FD false positive review allowed a downgrade. The legacy KP specialist produced a review artifact and its decision was processed by the applicable KP rules. The legacy FD or DH downgrade specialist produced a review artifact and its decision was processed by the applicable downgrade and preservation rules. Exact triggered rule markers were DECREASED_TO_MODERATE7_BASED_ON_FALSEPOSCHECKOFDH. The independent weaker Aegis shadow evaluated CVSS 2.5 and ActionableScore 5 with primitive class CLASS_B and manual review REQUIRED. Its independently reconciled impact was MODERATE_KPANIC. The shadow agreed with the final production impact and aggregation did not change that impact. The final reported impact is MODERATE_KPANIC.';YES REQUIRES MANUAL CHECK; ,and ActionableScore result is Actionable Moderate / Strong Important candidate requiring manual review (with actual score 5) MAYBE REMOTE RACE LEAK UAF NETWORK HARDWARE LINUS SYZBOT KPANIC DECREASED_TO_MODERATE7_BASED_ON_FALSEPOSCHECKOFDH - - checked ====================================================================== ACTIONABLESCORE ANALYSIS ====================================================================== ActionableScore=5 PrimitiveClass=CLASS_B RealUAF=YES HostAdminRequired=NO NamespaceScopedPrivilege=NO ImportantCandidate=YES ManualReview=REQUIRED AutoDowngradeAllowed=NO RequiresHostUID0=NO AuthorizationDecisionBypass=NO ProtectedResourceImpact=NONE B4PendingReview=NO B4PendingConfirmed=NO 1. ActionableScore * Raw base score: 5. * Conservative score: 5; no floor or cap changed the score. * Raw paranoid score: 5. * Paranoid score: 5; stronger effects require unsupported reclaim or replacement control. * Final recommended bucket: **Actionable Moderate / Strong Important candidate requiring manual review**:: 2. Signal breakdown * +2 real UAF/lifetime violation: `mptcp_worker()` can complete and release the socket before the subsequent `sock_hold(sk)`. * +1 concrete post-lifetime mutation: `sock_hold()` increments `sk_refcnt` through a potentially freed socket pointer. This is a fixed refcount write, not an arbitrary write. * +1 local unprivileged trigger: the supplied evidence grounds reproduction through a process controlling its own MPTCP socket. * +1 reliable crash/strong DoS concern: refcount-on-zero is observed, and stale or reused socket storage can produce a fatal kernel fault. * +1 attacker-influenced lifetime sequence: the process can exercise connection activity, timeout behavior, and socket teardown relevant to the race. * -1 hard timing: the worker must run and complete between `schedule_work()` and the immediately following `sock_hold()`. Not awarded: remote reachability, controlled reclaim, attacker-selected payload or target, arbitrary write, confidentiality, integrity, LPE, or extra availability. This is not a repeated-release case: no first `put` followed by a second `put` on the exact surviving reference. FLOOR 5 was unnecessary because raw scoring already reached 5. 3. Reachability analysis A normal local process can create and operate its own MPTCP socket; host UID 0, capabilities, namespace-scoped privilege, prior privileged setup, and special hardware are not indicated. A remote peer may influence packet timing, but the complete remote-only trigger is not established. The race window is narrow, although syzbot demonstrates that it is reachable. 4. Primitive and severity reading The primitive is an active structured socket UAF followed by a write-like refcount increment at the stale address. It is CLASS_B: stronger than a cleanup-only stale read because the vulnerable operation mutates lifetime metadata, but CLASS_A is unsupported without controlled reuse, refcount takeover, or a directed corruption target. Shown effects are refcount corruption and plausible host crash. Corruption of a reclaimed object is credible but its usefulness is unresolved. This material post-lifetime write makes Important-vs-Moderate review necessary and prevents automatic downgrade. 5. One-sentence report phrase An unprivileged local MPTCP socket race can free the socket before `sock_hold()` performs a stale refcount write, causing a real UAF and possible kernel crash or reused-object corruption. 6. Manual review advice MANUAL CHECK REQUIRED The concrete post-free refcount mutation requires exploit-leverage and slab-reuse analysis. 7. Call-site confidence Call-site confidence: high ====================================================================== UPSTREAM PATCH SUMMARY ====================================================================== Patch: mptcp: fix race condition in mptcp_schedule_work() Commit: 8f9ba1a99a89feef9b5867c15a0141a97e893309 Upstream URL: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=8f9ba1a99a89feef9b5867c15a0141a97e893309 Commit description: 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 Cc: stable@vger.kernel.org Fixes: 3b1d621 ("mptcp: implement and use MPTCP-level retransmission") Reported-by: syzbot+355158e7e301548a1424@syzkaller.appspotmail.com Closes: https://lore.kernel.org/netdev/6915b46f.050a0220.3565dc.0028.GAE@google.com/T/#u Signed-off-by: Eric Dumazet Reviewed-by: Matthieu Baerts (NGI0) Link: https://patch.msgid.link/20251113103924.3737425-1-edumazet@google.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman Changed files: lib/refcount.c include/linux/refcount.h include/net/sock.h net/mptcp/protocol.c kernel/time/timer.c kernel/softirq.c kernel/smpboot.c kernel/kthread.c arch/x86/kernel/process.c arch/x86/entry/entry_64.S Diff excerpt: Not included in this email. See the upstream URL for the full patch. Full patch: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=8f9ba1a99a89feef9b5867c15a0141a97e893309 ====================================================================== DETAILED REPORT METHODOLOGY ====================================================================== The original Linux kernel CVE announcement for CVE-2025-40258 can be found here: https://lore.kernel.org/linux-cve-announce/?q=CVE-2025-40258 The original CVE announcement normally does not include a security-level estimate. In particular, it may not contain a CVSS assessment, an impact level, or enough information to determine whether the reported bug is a practically relevant security issue. One purpose of this parallel CVE list is to provide that missing technical and prioritization information. The original goal of the AL-KERNEL project was to prioritize Linux kernel CVE analysis automatically before manual review. The system can also help identify non-security issues that may be suitable for automatic closure. This report was generated by AL-KERNEL, an AI-assisted Linux kernel vulnerability analysis system developed by Alexander Larkin. The first analysis stage combines an autonomous classifier with additional LLM-based analysis. The autonomous classifier runs locally on a CPU and is based on a backpropagation neural network. Together, these mechanisms produce a technical vulnerability description, identify likely weakness types, estimate CVSS severity, and provide input for ActionableScore. Two CVSS estimates are retained because incomplete kernel vulnerability information often permits more than one defensible interpretation: Conservative CVSS vector: AV:L/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:H The Best / paranoid CVSS vector: AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H The Best / paranoid CVSS score: 8.1 The conservative vector represents a lower-impact interpretation. The Best/paranoid vector intentionally represents a plausible upper-bound interpretation and should not automatically be treated as demonstrated real-world impact. CVSS may also need to be adjusted for a particular Linux deployment, because actual reachability, privileges, enabled kernel configuration, hardware, namespaces, exposed device nodes, and other environmental conditions can differ significantly between systems. A separate ActionableScore mechanism evaluates practical remediation urgency. Its analysis may include reachability, attack prerequisites, subsystem exposure, memory-corruption characteristics, denial-of-service reliability, and possible confidentiality, integrity, or privilege-escalation impact. Conservative ActionableScore: unknown Paranoid ActionableScore: 5 The final base severity is taken directly from the second tab-separated field of the AL-KERNEL classification result. ActionableScore does not replace or independently override that final AL-KERNEL decision, and if ActionableScore adjusted impact level of ALKERNEL, then you would see self-readable flags above like INCREASED_TO_HIGH_BASED_ON_ACTIONABLESCOREHIGHEREQTHAN7. For an AL-KERNEL result of MODERATE, this report uses the following additional presentation split: ActionableScore below 5 -> MODERATE REGULAR ActionableScore 5 or more -> MODERATE 7.0 The distinction between MODERATE REGULAR and MODERATE 7.0 makes it possible to identify Moderate issues that should receive manual analysis and fixes before lower-priority MODERATE REGULAR issues. In many cases, MODERATE REGULAR fixes may wait for a later rebase or routine update. There is one override in which MODERATE REGULAR becomes MODERATE 7.0 even when the ActionableScore is below 5. When the AL-KERNEL result contains the KPANIC flag, a MODERATE result is always presented as MODERATE 7.0. The KPANIC flag selected with few regexps without usage of AI at all, so it helps to detect cases when Kernel Crash happens and similar (to filter False-Negative results from the LLM usage). KPANIC indicates that a reliable kernel crash, kernel panic, or similarly serious kernel availability impact was identified by the classification workflow. AL-KERNEL base severity for this report: MODERATE KPANIC detected for this report: YES Published priority for this report (same as in Subject): MODERATE 7.0 These results are intended to support engineering triage. They are machine-generated estimates, and cases marked for manual review should be validated by a human security engineer before final disposition. For more info read docs linked from here: https://kernelcve.org/ (and you can submit you own patch there to generate such a report for non-existant CVE-id yet). Note that in many cases this AI tool selects higher severity, than real is (means you can expect Importants instead of Moderate 7.0 or Moderates 7.0 instead of regular Moderates). If you see such cases, please use reply email interface to add additional manual analyses info to this particular CVE. And please, please, let me know when you see Lows instead of Importants or Important instead of Low (because particular for such cases I need to tune this AI tool to make it better for this one and next similar). My contact email for such notifications is alexanjelausa@gmail.com (and both send reply to CVE record itself too and see "reply" button below for howto reply).