Get a Demo

Let's Patch It!

Book a short call with one our specialists, we'll walk you through how Endor Patches work, and ask you a few questions about your environment (like your primary programming languages and repository management). We'll also send you an email right after you fill out the form, feel free to reply with any questions you have in advance!

CVE

CVE-2026-64142

ksmbd: close durable scavenger races against m_fp_list lookups
Back to all
CVE

CVE-2026-64142

ksmbd: close durable scavenger races against m_fp_list lookups

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

ksmbd: close durable scavenger races against mfplist lookups

ksmbddurablescavenger() has two related races against any walker

that iterates fci->mfplist, including ksmbdlookupfdinode()

(used by ksmbdvfsrename) 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 fci->mfp_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 listhead used by mfp_list,

listadd(&fp->node, &scavengerlist) overwrites the mfplist links

and corrupts both lists.  CONFIGDEBUGLIST can report this on the

share-mode walk path.

(2) Refcount race against mfplist walkers.  The scavenger qualifies

an expired durable handle with atomic_read(&fp->refcount) > 1 and

fp->conn under globalft.lock, removes fp from globalft, then drops

globalft.lock before unlinking fp from mfp_list and freeing it.

During that gap fp is still linked on mfplist with f_state ==

FPINITED.  ksmbdlookupfdinode() under m_lock read calls

ksmbdfpget() (atomicincnot_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 ksmbdfdput() and on any field reads performed by a

concurrent share-mode walker that iterates mfplist without taking

ksmbdfpget() (smbcheckperm_dleases-like paths).

Fix both:

  • Stop reusing fp->node as a scavenger-private list node.  Remove

    one expired handle from globalft under globalft.lock, take an

    explicit transient reference, drop the lock, unlink fp->node

    from mfplist under fci->mlock, then drop both the durable

    lifetime and transient references with atomicsuband_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 mfplist lookup owns the final close via its

    ksmbdfdput() 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->persistentid inside ksmbdremovedurablefd() 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 idralloccyclic() in ksmbdopendurable_fd() may have

    already handed out to a brand-new durable handle.

  • Bypass the per-conn openfilescount decrement in

    _putfd_final() when fp is detached from any session table

    (fp->conn cleared by sessionfdcheck() 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.openfilescount 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 mfplist 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:

  • CONFIGDEBUGLIST coverage for the list_head reuse path.
  • KASAN-enabled direct SMB2 durable-handle coverage that exercised

    ksmbddurablescavenger() and non-NULL ksmbdlookupfd_inode()

    returns while durable handles expired under concurrent rename

    lookups, with no KASAN, UAF, list-corruption, ODEBUG, or WARNING

    reports.

---truncated---

Package Versions Affected

Package Version
patch Availability
No items found.

Automatically patch vulnerabilities without upgrading

Fix Without Upgrading
Detect compatible fix
Apply safe remediation
Fix with a single pull request

CVSS Version

Severity
Base Score
CVSS Version
Score Vector
C
H
U
9.8
-
3.1
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
C
H
U
0
-
3.1
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
C
H
U
-

Related Resources

No items found.

References

https://git.kernel.org/stable/c/1f8f3246d55f89350a1a67bdf3744b7241048e4e, https://git.kernel.org/stable/c/3a436932eb397e909d0607d76a8325abd9d85a35, https://git.kernel.org/stable/c/5da69a65b282d2276de22e5194ba0f88c836170c, https://git.kernel.org/stable/c/95f072ef934ca00711d510676b8792cbf59a5aae, https://git.kernel.org/stable/c/bf736184d063da1a552ffeff0481813599a182cc, https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/64xxx/CVE-2026-64142.json, https://nvd.nist.gov/vuln/detail/CVE-2026-64142, https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

Severity

9.8

CVSS Score
0
10

Basic Information

Base CVSS
9.8
EPSS Probability
0.00527%
EPSS Percentile
0.42561%
Introduced Version
7f0cb478703cbeaddfe5c9101c5c73cd975d1073,d484d621d40f4a8b8959008802d79bef3609641b,6.11.0,6.13.0,6.19.0,0
Fix Available
3a436932eb397e909d0607d76a8325abd9d85a35,bf736184d063da1a552ffeff0481813599a182cc,6.12.92,6.18.34,7.0.11,6.12.94-1,7.0.0-28.28~24.04.1,7.0.0-1016.16~24.04.1,7.0.0-28.28.1~24.04.3

Fix Critical Vulnerabilities Instantly

Secure your app without upgrading.
Fix Without Upgrading