# CVE-2025-68809: ksmbd: vfs: fix race on m\_flags in vfs\_cache

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** CRITICAL 9.1
- **CVSS:** 9.1 (v3.1, CNA) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H`
- **CVSS metrics:** Attack vector: Network; Attack complexity: Low; Privileges required: None; User interaction: None; Scope: Unchanged; Confidentiality impact: None; Integrity impact: High; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Remote, no login needed
- **EPSS:** 0.80% (percentile 53, 2026-11-26)
- **Published:** 2026-01-13T15:29:15.817Z
- **Modified:** 2026-10-30T13:18:24.440Z

## Who should check

- Anyone running Linux \>= f44158485826c076335d6860d35872271a83791d, \< a4fd1fdf505facfae26b5654c9eff321f4cbc1a7; \>= f44158485826c076335d6860d35872271a83791d, \< 5adad9727a815c26013b0d41cfee92ffa7d4037c; \>= f44158485826c076335d6860d35872271a83791d, \< ccc78781041589ea383e61d5d7a1e9a31b210b93; \>= f44158485826c076335d6860d35872271a83791d, \< ee63729760f5b61a66f345c54dc4c7514e62383d; \>= f44158485826c076335d6860d35872271a83791d, \< 991f8a79db99b14c48d20d2052c82d65b9186cad
- Anyone running Linux 5.15

## Description

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.

## Affected and fixed versions

- Linux: \>= f44158485826c076335d6860d35872271a83791d, \< a4fd1fdf505facfae26b5654c9eff321f4cbc1a7; \>= f44158485826c076335d6860d35872271a83791d, \< 5adad9727a815c26013b0d41cfee92ffa7d4037c; \>= f44158485826c076335d6860d35872271a83791d, \< ccc78781041589ea383e61d5d7a1e9a31b210b93; \>= f44158485826c076335d6860d35872271a83791d, \< ee63729760f5b61a66f345c54dc4c7514e62383d; \>= f44158485826c076335d6860d35872271a83791d, \< 991f8a79db99b14c48d20d2052c82d65b9186cad (cvelist)
- Linux: 5.15 (cvelist)

## Mitigation

- Upgrade Linux to 991f8a79db99b14c48d20d2052c82d65b9186cad or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2025-68809. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2025-68809.md
Affected: Linux >= f44158485826c076335d6860d35872271a83791d, < a4fd1fdf505facfae26b5654c9eff321f4cbc1a7; >= f44158485826c076335d6860d35872271a83791d, < 5adad9727a815c26013b0d41cfee92ffa7d4037c; >= f44158485826c076335d6860d35872271a83791d, < ccc78781041589ea383e61d5d7a1e9a31b210b93; >= f44158485826c076335d686…
Fixed in: Linux 5adad9727a815c26013b0d41cfee92ffa7d4037c, Linux 991f8a79db99b14c48d20d2052c82d65b9186cad

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2025-68809 being exploited?

There is no confirmed exploitation: CVE-2025-68809 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.80% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2025-68809?

Critical: CVSS 9.1 (v3.1, scored by CNA). Remote, no login needed.

### Which versions are affected by CVE-2025-68809?

Linux \>= f44158485826c076335d6860d35872271a83791d, \< a4fd1fdf505facfae26b5654c9eff321f4cbc1a7; \>= f44158485826c076335d6860d35872271a83791d, \< 5adad9727a815c26013b0d41cfee92ffa7d4037c; \>= f44158485826c076335d6860d35872271a83791d, \< ccc78781041589ea383e61d5d7a1e9a31b210b93; \>= f44158485826c076335d6860d35872271a83791d, \< ee63729760f5b61a66f345c54dc4c7514e62383d; \>= f44158485826c076335d6860d35872271a83791d, \< 991f8a79db99b14c48d20d2052c82d65b9186cad; Linux 5.15.

### Is there a fix for CVE-2025-68809?

Yes. Fixed in Linux 5adad9727a815c26013b0d41cfee92ffa7d4037c, Linux 991f8a79db99b14c48d20d2052c82d65b9186cad. Upgrade Linux to 991f8a79db99b14c48d20d2052c82d65b9186cad or later.

### How do I check if I'm affected by CVE-2025-68809?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- other: <https://git.kernel.org/stable/c/a4fd1fdf505facfae26b5654c9eff321f4cbc1a7>
- other: <https://git.kernel.org/stable/c/5adad9727a815c26013b0d41cfee92ffa7d4037c>
- other: <https://git.kernel.org/stable/c/ccc78781041589ea383e61d5d7a1e9a31b210b93>
- other: <https://git.kernel.org/stable/c/ee63729760f5b61a66f345c54dc4c7514e62383d>
- other: <https://git.kernel.org/stable/c/991f8a79db99b14c48d20d2052c82d65b9186cad>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2025-68809>

HTML: <https://flawdb.com/CVE-2025-68809> · JSON: <https://flawdb.com/api/v1/entries/CVE-2025-68809>
