Skip to main content

Linux Kernel ksmbd CVE-2026-31718

| EUVDEUVD-2026-26527 CRITICAL
Use After Free (CWE-416)
2026-05-01 416baaa9-dc9f-4396-8d5f-8c081fb06d67
9.8
CVSS 3.1 · Vendor: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Recon
    Authenticate to ksmbd SMB share
  2. Delivery
    Open file with durable handle flag
  3. Exploit
    Forcibly disconnect TCP without LOGOFF
  4. Install
    Wait for scavenger timeout
  5. C2
    Trigger __ksmbd_close_fd()
  6. Execute
    Dereference NULL fp->conn in lock cleanup
  7. Impact
    Slab use-after-free
  8. Step 8
    Kernel memory corruption

Vulnerability Assessment

Weakness
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Memory lifecycle management
MITRE ATT&CK

2 techniques across 2 tactics: Execution, Privilege Escalation

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Requires ksmbd kernel module to be loaded and actively serving SMB file shares - ksmbd is not enabled by default on most Linux distributions and must be explicitly configured. Attacker must establish an authenticated SMB2 or SMB3 session with a valid user account that has file access permissions. The session must successfully create a durable file handle (requires SMB 2.1+ and client requesting durable handle flag). Exploitation depends on specific timing: the TCP disconnect must occur without SMB2_LOGOFF, followed by the durable scavenger thread timeout (configuration-dependent, typically 60-300 seconds) before the client reconnects. Memory layout exploitation requires winning a race condition and predicting heap state, significantly limiting practical exploitation despite CVSS indicating low attack complexity. Scope is unchanged (S:U) meaning the vulnerable component and impacted component are the same (kernel).

Impact

Despite the critical CVSS 9.8 score (AV:N/AC:L/PR:N/UI:N), real-world risk is substantially lower. The CVSS vector indicates network-accessible unauthenticated exploitation with low complexity, but this contradicts the technical requirements: exploitation requires an established SMB session with durable handles, then triggering specific timing conditions between disconnect, scavenger execution, and memory reuse. EPSS score of 0.02% (5th percentile) aligns with the narrow exploitation window and specialized conditions. No CISA KEV listing and no public exploits indicate this is not being actively exploited. However, ksmbd is exposed on any Linux system configured as an SMB file server, and successful exploitation could yield kernel-level code execution. Priority should be medium-to-high for systems running ksmbd in production (enterprise file servers, NAS appliances), but low for default Linux installations where ksmbd is typically disabled. The primary concern is memory corruption leading to denial-of-service or potential privilege escalation, not remote unauthenticated compromise as the CVSS suggests.

Exploit ScenarioDerived

An attacker with network access to a ksmbd-enabled Linux file server establishes an SMB2 session, opens a file with a durable handle request, then forcibly disconnects the TCP session without proper SMB2_LOGOFF. The server preserves the durable handle and nulls fp->conn as designed. After waiting for the durable scavenger timeout (typically minutes), the scavenger thread calls __ksmbd_close_fd() which dereferences the freed connection object during lock cleanup, causing kernel memory corruption. With precise heap manipulation and timing, the attacker could achieve arbitrary kernel code execution.

Act Now Prioritize within 24-48h. Why: CRITICAL severity.
Patch available 0.0% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – May 03, 2026

Use-after-free in Linux kernel ksmbd (SMB server) during durable file handle scavenging allows memory corruption and potential remote code execution. When a durable SMB2 file handle survives session disconnect, the cleanup path dereferences a freed connection object via NULL fp->conn pointer during lock cleanup, causing a slab use-after-free. Exploitation probability is extremely low (EPSS 0.02%, 5th percentile) with no active exploitation confirmed. Vendor patches available across multiple stable kernel branches (6.12.84, 6.18.25, 7.0.2, 7.1-rc1) address the asymmetric cleanup by properly managing byte-range lock lifetimes during durable handle reconnection.

RemediationAI

Upgrade to patched Linux kernel versions: 6.12.84 or later in the 6.12.x series, 6.18.25 or later in 6.18.x series, 7.0.2 or later in 7.0.x series, or 7.1-rc1+ in mainline. Patches available at https://git.kernel.org/stable/c/b34fc42cfe922e551f7a27d3ac3bb016e41d7dd9 (6.12), https://git.kernel.org/stable/c/3d6682726c2d3a46d31dae88b8166786b09b03ad (6.18), https://git.kernel.org/stable/c/e33c65f011980b4ad4abfd93585ec2079856368f (7.0), and https://git.kernel.org/stable/c/235e32320a470fcd3998fb3774f2290a0eb302a1 (mainline). If immediate patching is not feasible, disable the ksmbd kernel module (rmmod ksmbd; systemctl disable ksmbd or equivalent) and use userspace Samba instead - note this requires service reconfiguration and will disrupt SMB file sharing. Alternatively, disable durable handle support in ksmbd configuration if supported by your version, though this may break compatibility with Windows clients. Restricting network access to SMB ports (445/tcp, 139/tcp) to trusted clients reduces attack surface but does not eliminate risk from authenticated users.

Affected VersionsENISA

Linux patch: 7.0.2
Linux patch: 6.18.25
Linux 8df4bcdb0a4232192b2445256c39b787d58ef14d
Linux patch: 7.1-rc1
Linux c8efcc786146a951091588e5fa7e3c754850cb3c <b34fc42cfe922e551f7a27d3ac3bb016e41d7dd9
Linux 6.9
Linux c8efcc786146a951091588e5fa7e3c754850cb3c <3d6682726c2d3a46d31dae88b8166786b09b03ad
Linux c8efcc786146a951091588e5fa7e3c754850cb3c <e33c65f011980b4ad4abfd93585ec2079856368f
Linux patch: 0
Linux patch: 6.12.84
Linux c8efcc786146a951091588e5fa7e3c754850cb3c <235e32320a470fcd3998fb3774f2290a0eb302a1

Affected Packages

euvd linux no fix

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

The vulnerability exists in ksmbd, the in-kernel SMB server implementation introduced in Linux 5.15. Durable file handles (SMB2 protocol feature) allow clients to maintain open file state across temporary disconnects. The bug affects the lock cleanup logic in __ksmbd_close_fd() called by the durable scavenger thread when handles timeout. When session_fd_check() nulls out fp->conn during disconnect but fails to clean up smb_lock entries from conn->lock_list, subsequent scavenger execution attempts to acquire conn->llist_lock through a NULL pointer, accessing previously freed memory. The root cause is a lifetime management bug where lock entries (smb_lock->clist) remain on the freed connection's lock_list while fp->conn is set to NULL, creating dangling pointers. The fix implements proper lock migration: removing locks from the old connection during disconnect and re-adding them to the new connection during durable handle reopening.

Know when the next one hits your stack

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (416baaa9-dc9f-4396-8d5f-8c081fb06d67) PRIMARY 9.8 CRITICAL
AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
SUSE CRITICAL

Primary rating from Vendor (416baaa9-dc9f-4396-8d5f-8c081fb06d67).

CVSS VectorVendor: 416baaa9-dc9f-4396-8d5f-8c081fb06d67

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

Lifecycle Timeline

4
CVSS changed
May 03, 2026 - 07:22 NVD
9.8 (CRITICAL)
Patch released
May 03, 2026 - 07:16 nvd
Patch available
Patch available
May 01, 2026 - 15:02 EUVD
CVE Published
May 01, 2026 - 14:16 nvd
CRITICAL 9.8

DescriptionCVE.org

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

ksmbd: fix use-after-free in __ksmbd_close_fd() via durable scavenger

When a durable file handle survives session disconnect (TCP close without SMB2_LOGOFF), session_fd_check() sets fp->conn = NULL to preserve the handle for later reconnection. However, it did not clean up the byte-range locks on fp->lock_list.

Later, when the durable scavenger thread times out and calls __ksmbd_close_fd(NULL, fp), the lock cleanup loop did:

spin_lock(&fp->conn->llist_lock);

This caused a slab use-after-free because fp->conn was NULL and the original connection object had already been freed by ksmbd_tcp_disconnect().

The root cause is asymmetric cleanup: lock entries (smb_lock->clist) were left dangling on the freed conn->lock_list while fp->conn was nulled out.

To fix this issue properly, we need to handle the lifetime of smb_lock->clist across three paths:

  • Safely skip clist deletion when list is empty and fp->conn is NULL.
  • Remove the lock from the old connection's lock_list in

session_fd_check()

  • Re-add the lock to the new connection's lock_list in

ksmbd_reopen_durable_fd().

Executive ViewAI

Why It Matters

CVE-2026-31718 is a critical use-after-free vulnerability in the Linux kernel's SMB server (ksmbd) that could enable remote code execution through malformed durable file handle reconnection requests. Linux-based file servers and network-attached storage systems running vulnerable kernel versions face potential compromise of system integrity and confidentiality. While exploitation probability is extremely low and no active attacks have been confirmed, the CRITICAL severity rating and confirmed availability of vendor patches warrant immediate patching of production systems.

Business Impact: High
Compensating Controls

Apply vendor patch. If immediate patching is not feasible, restrict SMB access to trusted networks via firewall rules limiting port 445 ingress, disable durable handle support in ksmbd configuration if operationally acceptable, and implement network segmentation to isolate file servers from untrusted clients.

Threat Intelligence Overview

EPSS Score
0.0%
Top 95% exploitable
Threat Intel
1
1 sources
Data Quality
6 sources
Confidence: High

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity CRITICAL
CISA KEV No
Public POC No
EPSS 0.0%
Patch available Yes
Active threat No
Deciding rule
CRITICAL severity
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Open
Automatable· derived
Yes
Human Impact
High

Priority Score

49
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +49
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Use-after-free vulnerabilities occur when a program continues to access memory through a pointer after that memory has been deallocated.

Memory corruption occurs when a program writes data beyond the boundaries of allocated memory regions or accesses memory in unintended ways, violating the integrity of the process's address space.

Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.

Vendor StatusVendor

SUSE

Severity: Critical
Product Status
SUSE Linux Enterprise Desktop 15 SP7 Fixed
SUSE Linux Enterprise Desktop 15 SP7 Fixed
SUSE Linux Enterprise High Availability Extension 15 SP7 Fixed
SUSE Linux Enterprise High Availability Extension 15 SP7 Fixed
SUSE Linux Enterprise High Performance Computing 15 SP7 Fixed

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