CVE-2025-21945: ksmbd: fix use-after-free in smb2_lock
In the Linux kernel, the following vulnerability has been resolved:
ksmbd: fix use-after-free in smb2_lock
If smb_lock->zero_len has value, ->llist of smb_lock is not delete and
flock is old one. It will cause use-after-free on error handling
routine.
Security readout for executives and security teams
Plain-English summary
A flaw in the Linux kernel’s ksmbd SMB file server can access memory after it has been freed while handling file locks. A low-privileged network user may be able to trigger serious confidentiality, integrity, or availability impact. Systems not using ksmbd are unlikely to be exposed through this component.
Executive priority
Prioritize internet-facing, partner-accessible, or broadly reachable ksmbd servers. Patch promptly because triggering requires only low privileges and could affect all three security objectives. Treat systems without ksmbd as lower priority after confirming the service is genuinely inactive.
Technical view
In smb2_lock error handling, a lock with zero_len may retain its linked-list entry and an obsolete flock reference, causing a use-after-free. The supplied CVSS 3.1 score is 8.8: network-accessible, low complexity, low privileges required, no user interaction, and potentially high impact across confidentiality, integrity, and availability.
Likely exposure
Exposure is concentrated on Linux systems running ksmbd and accepting SMB connections from low-privileged users. The supplied affected-version data identifies several kernel branches but is insufficient for reliable distribution-package mapping. Confirm exposure against the running kernel and vendor backport status.
Exploitation context
The CVSS vector indicates network reachability and low privileges are required. The source bundle does not establish whether successful exploitation reliably enables code execution or another specific outcome. CVE-2025-21945 is not marked as KEV, and the supplied sources provide no evidence of active exploitation.
Researcher notes
The defect is CWE-416 in ksmbd’s smb2_lock path. The supplied version list is ambiguous and repeats commit identifiers, so commit or distribution-backport verification is safer than version-string assumptions. The sources establish a memory-safety defect and stable fixes, but not a demonstrated exploitation primitive or observed attacks.
Mitigation direction
Apply the distribution or kernel-vendor update containing the applicable cited stable fix.
Confirm the exact fixed package or backport for every deployed kernel branch.
Until patched, restrict ksmbd access to trusted networks and necessary accounts.
Disable ksmbd where it is not operationally required, following vendor guidance.
Validation and detection
Inventory systems where ksmbd is enabled and identify who can reach their SMB service.
Record each running kernel version and compare it with vendor security guidance and backport information.
Verify the installed kernel contains the applicable stable fix or documented downstream backport.
Ensure systems booted into the updated kernel after installation.
Review kernel telemetry for ksmbd-related memory faults; their absence does not establish remediation.
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
7Source 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.