CVE-2025-68809: ksmbd: vfs: fix race on m_flags in vfs_cache
In the Linux kernel, the following vulnerability has been resolved:
ksmbd: vfs: fix race on m_flags in vfs_cache
ksmbd maintains delete-on-close and pending-delete state in
ksmbd_inode->m_flags. In vfs_cache.c this field is accessed under
inconsistent locking: some paths read and modify m_flags under
ci->m_lock while others do so without taking the lock at all.
Examples:
- ksmbd_query_inode_status() and __ksmbd_inode_close() use
ci->m_lock when checking or updating m_flags.
- ksmbd_inode_pending_delete(), ksmbd_set_inode_pending_delete(),
ksmbd_clear_inode_pending_delete() and ksmbd_fd_set_delete_on_close()
used to read and modify m_flags without ci->m_lock.
This creates a potential data race on m_flags when multiple threads
open, close and delete the same file concurrently. In the worst case
delete-on-close and pending-delete bits can be lost or observed in an
inconsistent state, leading to confusing delete semantics (files that
stay on disk after delete-on-close, or files that disappear while still
in use).
Fix it by:
- Making ksmbd_query_inode_status() look at m_flags under ci->m_lock
after dropping inode_hash_lock.
- Adding ci->m_lock protection to all helpers that read or modify
m_flags (ksmbd_inode_pending_delete(), ksmbd_set_inode_pending_delete(),
ksmbd_clear_inode_pending_delete(), ksmbd_fd_set_delete_on_close()).
- Keeping the existing ci->m_lock protection in __ksmbd_inode_close(),
and moving the actual unlink/xattr removal outside the lock.
This unifies the locking around m_flags and removes the data race while
preserving the existing delete-on-close behaviour.
Security readout for executives and security teams
Plain-English summary
A race condition in Linux’s ksmbd SMB server can mishandle file deletion state when concurrent operations target the same file. Files may remain after delete-on-close or disappear while still in use, threatening data integrity and service availability. The supplied CVSS score is 9.1.
Executive priority
Treat internet-accessible or broadly reachable ksmbd servers as an urgent patching priority because incorrect deletion state can affect integrity and availability. Prioritise exposed file servers and sensitive shares. Where ksmbd is unused, disabling it can reduce exposure while vendor remediation is assessed.
Technical view
Inconsistent use of ksmbd_inode->ci->m_lock allows concurrent unsynchronised reads and updates of m_flags. Lost or inconsistent pending-delete and delete-on-close bits can produce incorrect file lifecycle behavior. The kernel fix consistently locks m_flags access and moves unlink and extended-attribute removal outside the lock.
Likely exposure
Exposure is limited to systems using ksmbd and running affected Linux versions identified in the bundle, including listed 5.15, 6.6.120, 6.12.64, 6.18.3, and 6.19 entries. Network-reachable SMB services warrant priority. The bundle’s version data is incomplete and contains ambiguous or duplicate entries, so distribution-specific package status must be confirmed.
Exploitation context
The supplied record marks this CVE as absent from KEV and provides no evidence of active exploitation or a public exploit. The race requires concurrent file open, close, and delete activity. The CVSS vector describes network reachability without privileges or user interaction, but practical exploitability is not established by the supplied sources.
Researcher notes
The defect concerns synchronization of m_flags in vfs_cache.c, not demonstrated memory corruption. The supplied fix protects all relevant helpers with ci->m_lock, changes query lock ordering, and performs unlink or xattr removal outside that lock. No CWE is supplied. Exact affected and fixed package boundaries require vendor confirmation.
Mitigation direction
Install a vendor kernel update containing the applicable stable fix.
Check distribution advisories to map packaged kernels to the listed upstream fixes.
Disable ksmbd if it is unnecessary and operationally safe to do so.
Restrict SMB network access to trusted clients until remediation is confirmed.
Validation and detection
Confirm whether ksmbd is enabled, loaded, and serving SMB connections.
Record the running kernel and compare it with distribution-specific security guidance.
Verify the installed kernel includes the applicable referenced stable commit.
After updating, confirm the remediated kernel is running following any required reboot.
Review file deletion anomalies and service logs, without treating their 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.
cve · low confidence lookup
CVE-2025-68809 mapping review
Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.
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.
1CVSS vectors
3Timeline events
0ADP providers
5Source links
CVSS vector scores
1 official score
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.