CVE-2025-22040: ksmbd: fix session use-after-free in multichannel connection
In the Linux kernel, the following vulnerability has been resolved:
ksmbd: fix session use-after-free in multichannel connection
There is a race condition between session setup and
ksmbd_sessions_deregister. The session can be freed before the connection
is added to channel list of session.
This patch check reference count of session before freeing it.
Security readout for executives and security teams
Plain-English summary
A race in Linux’s ksmbd SMB server can free a session while another connection is still attaching to it. The resulting use-after-free may crash the system or corrupt kernel memory, potentially affecting confidentiality, integrity, and availability. Risk is concentrated on systems that run ksmbd and accept reachable SMB connections.
Executive priority
Treat as a high-priority patching issue for reachable ksmbd servers, especially systems serving less-trusted clients. Systems not using ksmbd are unlikely to be directly exposed. Because active exploitation is not established, prioritize through normal emergency-risk processes rather than declaring an active incident solely from this CVE.
Technical view
CVE-2025-22040 is a CWE-416 use-after-free caused by a race between session setup and ksmbd_sessions_deregister during multichannel connection handling. A session may be freed before the connection joins its channel list. The kernel fix checks the session reference count before freeing it. CVSS 3.1 is 8.8: network-accessible, low complexity, low privileges, and no user interaction.
Likely exposure
Likely exposure is limited to Linux systems using the in-kernel ksmbd SMB server, particularly where SMB multichannel connections are possible and the service is network-reachable. The supplied affected-version metadata includes 5.15 and several 6.x entries, but does not clearly express branch-specific boundaries. Confirm exposure against distribution advisories and package changelogs.
Exploitation context
The CVSS vector indicates a network attacker with low privileges could potentially trigger the flaw without user interaction. However, the supplied bundle reports that CVE-2025-22040 is not in KEV and provides no evidence of active exploitation or a public exploit. Practical reliability and impact beyond the described kernel-memory race remain unconfirmed.
Researcher notes
The central primitive is a session lifetime race across setup, deregistration, and multichannel list insertion. The patch description identifies reference-count validation as the correction. The bundle lists several stable-tree commits but does not map each commit to precise vulnerable and fixed release ranges. Validate using the exact distribution kernel build, not upstream version strings alone.
Mitigation direction
Install a vendor-supported kernel update that includes the applicable stable fix.
Check distribution guidance because fixed versions vary across maintained kernel branches.
Prioritize systems exposing ksmbd to untrusted or broadly reachable networks.
If immediate updating is impossible, request vendor-approved temporary mitigations for ksmbd exposure.
Validation and detection
Identify systems loading or configuring ksmbd and determine whether SMB is network-reachable.
Record each running kernel version, distribution package release, and active booted kernel.
Match package changelogs or vendor advisories to CVE-2025-22040 and the cited stable commits.
After updating, reboot if required and verify the fixed kernel is running.
Review kernel logs for ksmbd crashes or memory-safety faults, without treating absence as proof of safety.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
cwe · low confidence lookup
CWE-416: Exact CWE lookup
Use the exact CWE identifier as the starting point before reviewing related ATT&CK behavior. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.
2CVSS vectors
3Timeline events
2ADP providers
8Source links
SSVC decision data
CISA-ADPCISA Coordinator
Timestamp
Version
2.0.3
Exploitation: noneAutomatable: noTechnical Impact: total
CVSS vector scores
2 official scores
We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.
CWE links open Glexia weakness intelligence pages with official CWE context, developer remediation guidance, and related CVE mappings.
CWE-416 · source CWE mapping
Use After Free
Use After Free represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.