Skip to main content

Linux Kernel ksmbd CVE-2026-64142

| EUVDEUVD-2026-45827 CRITICAL
Use After Free (CWE-416)
2026-07-19 Linux GHSA-jcg5-p7gf-vq99
9.8
CVSS 3.1 · Vendor: Linux
Share

Severity by source

Vendor (Linux) PRIMARY
9.8 CRITICAL
AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
vuln.today AI
7.5 HIGH

Remote SMB reachability gives AV:N, but the timing-dependent scavenger race is AC:H and durable-handle creation needs an authenticated session (PR:L); kernel UAF can corrupt memory so C/I/A:H.

3.1 AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H
4.0 AV:N/AC:H/AT:P/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
SUSE
CRITICAL
qualitative

Primary rating from Vendor (Linux).

CVSS VectorVendor: Linux

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

Lifecycle Timeline

5
Analysis Generated
Jul 20, 2026 - 17:43 vuln.today
CVSS changed
Jul 20, 2026 - 15:22 NVD
9.8 (CRITICAL)
Patch available
Jul 19, 2026 - 17:03 EUVD
CVE Published
Jul 19, 2026 - 15:40 cve.org
UNKNOWN (no severity yet)
CVE Published
Jul 19, 2026 - 15:40 cve.org
CRITICAL 9.8

DescriptionCVE.org

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---

AnalysisAI

Use-after-free in the Linux kernel's ksmbd (in-kernel SMB3 server) durable-handle scavenger allows a remote client interacting with SMB2 durable handles to corrupt kernel memory and free a file object still referenced by concurrent m_fp_list walkers. The flaw stems from two related races in ksmbd_durable_scavenger() - a list_head reuse that corrupts f_ci->m_fp_list and a refcount/unlink race that leaves a freed handle reachable by rename and share-mode lookups. There is no public exploit identified at time of analysis, EPSS is low (0.18%, 7th percentile), and it is not in CISA KEV, so exploitation is unproven despite the NVD 9.8 rating.

Technical ContextAI

ksmbd is the kernel-space SMB3 file server introduced in fs/smb/server. SMB2 'durable handles' let a client transparently reconnect to an open file handle after a network drop, so ksmbd preserves the corresponding file object (fp) on the inode's f_ci->m_fp_list even after session teardown while the handle remains reconnectable. A background scavenger thread expires stale durable handles. The bug is a classic race-condition-induced use-after-free (CWE-416 combined with CWE-362; the input CWE is N/A and this class is inferred from the description): (1) the scavenger reused fp->node - the same list_head that links m_fp_list - as a private scavenger-list node, overwriting the m_fp_list links (detectable by CONFIG_DEBUG_LIST); and (2) it qualified an expired handle under global_ft.lock, dropped that lock before unlinking fp from m_fp_list and freeing it, leaving a window where fp is still linked with f_stateFP_INITED and refcount1, so ksmbd_lookup_fd_inode() (via ksmbd_vfs_rename) or smb_check_perm_dleases-style share-mode walkers could take or read a reference to an object the scavenger then frees. The fix stops reusing fp->node, takes an explicit transient reference with atomic_sub_and_test(2,...) disposal, clears fp->persistent_id right after idr_remove() to avoid double-remove against a recycled persistent id, and skips the open_files_count decrement for session-detached durable fps.

RemediationAI

Vendor-released patch: update to a fixed stable kernel - 6.12.92, 6.18.34, 7.0.11, or 7.1 (or later) per EUVD-2026-45827 - corresponding to git.kernel.org commits 3a436932eb39, 95f072ef934c, 5da69a65b282, 1f8f3246d55f and bf736184d063. If you cannot patch immediately and do not require the in-kernel SMB server, the strongest compensating control is to stop and unload the ksmbd module (blacklist ksmbd) and serve SMB via user-space Samba instead, which fully removes the exposure but changes your file-sharing stack. Where ksmbd must stay running, restrict share access to trusted authenticated users and firewall TCP/445 to known clients to shrink the attacker population that can drive the race, and consider disabling SMB2 durable handles in the share configuration - the trade-off is that clients lose transparent handle reconnection across network interruptions. These controls reduce likelihood but do not eliminate the underlying UAF, so patching remains the real fix.

Vendor StatusVendor

SUSE

Severity: Critical
Product Status
SUSE Linux Enterprise Desktop 15 SP7 Affected
SUSE Linux Enterprise Desktop 15 SP7 Affected
SUSE Linux Enterprise High Availability Extension 15 SP7 Affected
SUSE Linux Enterprise High Availability Extension 15 SP7 Affected
SUSE Linux Enterprise High Availability Extension 16.0 Affected

Share

CVE-2026-64142 vulnerability details – vuln.today

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy