# CVE-2026-64142: ksmbd: close durable scavenger races against m\_fp\_list lookups

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

- **Severity:** CRITICAL 9.8
- **CVSS:** 9.8 (v3.1, CNA) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Network; Attack complexity: Low; Privileges required: None; User interaction: None; Scope: Unchanged; Confidentiality impact: High; 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.70% (percentile 49, 2026-11-26)
- **CWE:** CWE-416
- **Published:** 2026-07-19T15:40:34.605Z
- **Modified:** 2026-08-17T19:40:06.100Z

## Who should check

- Anyone running Linux \>= 7f0cb478703cbeaddfe5c9101c5c73cd975d1073, \< 3a436932eb397e909d0607d76a8325abd9d85a35; \>= d484d621d40f4a8b8959008802d79bef3609641b, \< 95f072ef934ca00711d510676b8792cbf59a5aae; \>= d484d621d40f4a8b8959008802d79bef3609641b, \< 5da69a65b282d2276de22e5194ba0f88c836170c; \>= d484d621d40f4a8b8959008802d79bef3609641b, \< 1f8f3246d55f89350a1a67bdf3744b7241048e4e; \>= d484d621d40f4a8b8959008802d79bef3609641b, \< bf736184d063da1a552ffeff0481813599a182cc
- Anyone running Linux 6.11

## Description

In the Linux kernel, the following vulnerability has been resolved:

ksmbd: close durable scavenger races against m\_fp\_list lookups

ksmbd\_durable\_scavenger() has two related races against any walker
that iterates f\_ci-\>m\_fp\_list, including ksmbd\_lookup\_fd\_inode()
(used by ksmbd\_vfs\_rename) and the share-mode checks in
fs/smb/server/smb\_common.c.

(1) fp-\>node list-head reuse.  Durable-preserved handles can remain
linked on f\_ci-\>m\_fp\_list after session teardown so share-mode checks
still see them while the handle is reconnectable.  The scavenger
collected expired handles by adding fp-\>node to a local
scavenger\_list after removing them from the global durable idr.
Because fp-\>node is the same list\_head used by m\_fp\_list,
list\_add(&fp-\>node, &scavenger\_list) overwrites the m\_fp\_list links
and corrupts both lists.  CONFIG\_DEBUG\_LIST can report this on the
share-mode walk path.

(2) Refcount race against m\_fp\_list walkers.  The scavenger qualifies
an expired durable handle with atomic\_read(&fp-\>refcount) \> 1 and
fp-\>conn under global\_ft.lock, removes fp from global\_ft, then drops
global\_ft.lock before unlinking fp from m\_fp\_list and freeing it.
During that gap fp is still linked on m\_fp\_list with f\_state ==
FP\_INITED.  ksmbd\_lookup\_fd\_inode() under m\_lock read calls
ksmbd\_fp\_get() (atomic\_inc\_not\_zero on refcount that is still 1) and
takes a live reference; the scavenger then unlinks and frees fp
while the holder owns a reference, leading to UAF on the holder's
subsequent ksmbd\_fd\_put() and on any field reads performed by a
concurrent share-mode walker that iterates m\_fp\_list without taking
ksmbd\_fp\_get() (smb\_check\_perm\_dleases-like paths).

Fix both:

  \* Stop reusing fp-\>node as a scavenger-private list node.  Remove
    one expired handle from global\_ft under global\_ft.lock, take an
    explicit transient reference, drop the lock, unlink fp-\>node
    from m\_fp\_list under f\_ci-\>m\_lock, then drop both the durable
    lifetime and transient references with atomic\_sub\_and\_test(2,
    &fp-\>refcount).  If the scavenger is the last putter the close
    runs there; otherwise an in-flight holder that already raced
    through the m\_fp\_list lookup owns the final close via its
    ksmbd\_fd\_put() path.  The one-at-a-time disposal can rescan the
    durable idr when multiple handles expire in the same pass, but
    durable scavenging is a background expiration path and the final
    full scan recomputes min\_timeout before the next wait.

  \* Clear fp-\>persistent\_id inside \_\_ksmbd\_remove\_durable\_fd() right
    after idr\_remove(), so a delayed final close from a holder that
    snatched fp does not re-issue idr\_remove() on a persistent id
    that idr\_alloc\_cyclic() in ksmbd\_open\_durable\_fd() may have
    already handed out to a brand-new durable handle.

  \* Bypass the per-conn open\_files\_count decrement in
    \_\_put\_fd\_final() when fp is detached from any session table
    (fp-\>conn cleared by session\_fd\_check() at durable preserve --
    paired with the volatile\_id clear at unpublish, so checking
    fp-\>conn alone is sufficient).  The walker that owns the final
    close runs from an unrelated work-\>conn whose
    stats.open\_files\_count never tracked this durable fp; without
    this guard the holder would underflow that unrelated counter.

The two races are folded into one patch because patch (1) alone
cleans up the corrupted list but leaves a deterministic UAF window
for m\_fp\_list walkers that the transient-reference and
persistent\_id discipline in (2) close; bisecting onto an
intermediate state would land on a UAF that pre-patch chaos merely
made less reproducible.

Validation:
  \* CONFIG\_DEBUG\_LIST coverage for the list\_head reuse path.
  \* KASAN-enabled direct SMB2 durable-handle coverage that exercised
    ksmbd\_durable\_scavenger() and non-NULL ksmbd\_lookup\_fd\_inode()
    returns while durable handles expired under concurrent rename
    lookups, with no KASAN, UAF, list-corruption, ODEBUG, or WARNING
    reports.
---truncated---

## Affected and fixed versions

- Linux: \>= 7f0cb478703cbeaddfe5c9101c5c73cd975d1073, \< 3a436932eb397e909d0607d76a8325abd9d85a35; \>= d484d621d40f4a8b8959008802d79bef3609641b, \< 95f072ef934ca00711d510676b8792cbf59a5aae; \>= d484d621d40f4a8b8959008802d79bef3609641b, \< 5da69a65b282d2276de22e5194ba0f88c836170c; \>= d484d621d40f4a8b8959008802d79bef3609641b, \< 1f8f3246d55f89350a1a67bdf3744b7241048e4e; \>= d484d621d40f4a8b8959008802d79bef3609641b, \< bf736184d063da1a552ffeff0481813599a182cc (cvelist)
- Linux: 6.11 (cvelist)

## Mitigation

- No fix listed yet: follow the vendor advisory.

## Check your systems with an agent

Paste this into a coding agent:

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

Details: https://flawdb.com/CVE-2026-64142.md
Affected: Linux >= 7f0cb478703cbeaddfe5c9101c5c73cd975d1073, < 3a436932eb397e909d0607d76a8325abd9d85a35; >= d484d621d40f4a8b8959008802d79bef3609641b, < 95f072ef934ca00711d510676b8792cbf59a5aae; >= d484d621d40f4a8b8959008802d79bef3609641b, < 5da69a65b282d2276de22e5194ba0f88c836170c; >= d484d621d40f4a8b8959008…
Fixed in: Linux 3a436932eb397e909d0607d76a8325abd9d85a35, Linux 95f072ef934ca00711d510676b8792cbf59a5aae, Linux 5da69a65b282d2276de22e5194ba0f88c836170c, Linux 1f8f3246d55f89350a1a67bdf3744b7241048e4e

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-2026-64142 being exploited?

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

### How serious is CVE-2026-64142?

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

### Which versions are affected by CVE-2026-64142?

Linux \>= 7f0cb478703cbeaddfe5c9101c5c73cd975d1073, \< 3a436932eb397e909d0607d76a8325abd9d85a35; \>= d484d621d40f4a8b8959008802d79bef3609641b, \< 95f072ef934ca00711d510676b8792cbf59a5aae; \>= d484d621d40f4a8b8959008802d79bef3609641b, \< 5da69a65b282d2276de22e5194ba0f88c836170c; \>= d484d621d40f4a8b8959008802d79bef3609641b, \< 1f8f3246d55f89350a1a67bdf3744b7241048e4e; \>= d484d621d40f4a8b8959008802d79bef3609641b, \< bf736184d063da1a552ffeff0481813599a182cc; Linux 6.11.

### Is there a fix for CVE-2026-64142?

Yes. Fixed in Linux 3a436932eb397e909d0607d76a8325abd9d85a35, Linux 95f072ef934ca00711d510676b8792cbf59a5aae, Linux 5da69a65b282d2276de22e5194ba0f88c836170c, Linux 1f8f3246d55f89350a1a67bdf3744b7241048e4e. No fix listed yet: follow the vendor advisory.

### How do I check if I'm affected by CVE-2026-64142?

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

- patch: <https://git.kernel.org/stable/c/3a436932eb397e909d0607d76a8325abd9d85a35>
- patch: <https://git.kernel.org/stable/c/95f072ef934ca00711d510676b8792cbf59a5aae>
- patch: <https://git.kernel.org/stable/c/5da69a65b282d2276de22e5194ba0f88c836170c>
- patch: <https://git.kernel.org/stable/c/1f8f3246d55f89350a1a67bdf3744b7241048e4e>
- patch: <https://git.kernel.org/stable/c/bf736184d063da1a552ffeff0481813599a182cc>

## 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-2026-64142>

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