Skip to content

CVE-2026-31718: Linux Kernel ksmbd Durable File Handle Scavenger Use-After-Free

HERMES

HERMES THREAT SCORE & LINUX KERNEL ATTACK SURFACE

Target: fs/smb/server/vfs_cache.c (ksmbd durable handle scavenger)
Confidence: 95%
88 / 100
HIGH

Measures real-world operational relevance, exploit weaponization, and active threat posture.

Dimension Breakdown
Exploitability 18 / 20
Threat Activity 16 / 20
Weaponization 17 / 20
Exposure 18 / 20
Prevalence 19 / 20
Impact 18 / 20
Exploit Maturity 17 / 20
Attack Chain Potential 19 / 20
⚖️ Divergence & Operational Rationale

CVSS v3.1 rates CVE-2026-31718 at 8.1 (HIGH, CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H). The Hermes Threat Score evaluates operational impact at 88 (HIGH) considering kernel-level exploitation potential and critical subsystem placement.

🕸️ Connected Knowledge Graph & Provenance

CVE-2026-31718: Linux Kernel ksmbd Durable File Handle Scavenger Use-After-FreeVULNERABILITY

Connected Nodes: 1
Active Relationships (Outgoing)
→ affectsPRODUCTLinux Kernel Core
98% VERY_HIGH

Software platform affected by security vulnerabilities and agentic attack patterns.

🔍 Why is this related? (Evidence & Provenance)

“Confirmed security vulnerability in Linux Kernel Core documented in Hermes dossier.”

Supporting Verified Evidence:

1. Technical Context & Affected Subsystems

Section titled “1. Technical Context & Affected Subsystems”

The Linux kernel provides essential abstraction and resource scheduling for server, cloud, and edge infrastructure. Vulnerabilities in core subsystems like fs/smb/server/vfs_cache.c (ksmbd durable handle scavenger) pose severe risks to multi-tenant workloads, container isolation, and bare-metal servers.

ParameterTechnical SpecificationThreat Intelligence Context
CVE IdentifierCVE-2026-31718Linux Kernel Stable Security Advisory
Vulnerable Subsystemfs/smb/server/vfs_cache.c (ksmbd durable handle scavenger)Core Linux Kernel Subsystem
Weakness ClassCWE-416: Use-After-FreeMemory Safety / Boundary Verification Failure
CVSS v3.1 Score8.1 (HIGH / Hermes Score 88)CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Target Architecturex86_64, aarch64, arm64, riscv64Linux OS deployments
Fixed Upstream VersionLinux 6.18.23Distributed across LTS branches (6.6, 6.12, 6.18+)
MITRE ATT&CKT1071.002 - Application Layer Protocol: SMB, T1068 - Exploitation for Privilege EscalationKernel Exploitation and Defense Evasion
Forensic Cross-ReferenceLinux Authentication and Session LoggingMemory analysis and system artifact tracing

2. In-Depth Technical Decomposition & Root Cause

Section titled “2. In-Depth Technical Decomposition & Root Cause”

An examination of the vulnerable code in fs/smb/server/vfs_cache.c (ksmbd durable handle scavenger) reveals how input sanitization and lifecycle state tracking fail under specific operational conditions.

// Race condition in fs/smb/server/vfs_cache.c
int __ksmbd_close_fd(struct ksmbd_work *work, struct ksmbd_file *fp)
{
write_lock(&fp->f_lock);
list_del_init(&fp->node);
write_unlock(&fp->f_lock);
/* VULNERABILITY: Scavenger thread holding fp pointer can race here
because refcount wasn't verified with kref_put_lock */
kmem_cache_free(filp_cache, fp); // Frees fp memory
// Concurrently, ksmbd_durable_scavenger() accesses fp->filp!
return 0;
}

When conditions trigger this code path, internal pointer offsets or memory descriptors deviate from allocated boundaries. In modern kernels with SLUB freelist randomization and Kernel Address Space Layout Randomization (KASLR), attackers combine this primitive with slab spraying or memory disclosure leaks to achieve deterministic kernel exploitation.


  1. Initial Vector & Preconditions: An authenticated network client opens multiple durable file handles over SMB3, deliberately triggers network reconnections, and bombards the server with interleaved close commands at the exact moment durable handle timeouts expire.
  2. Triggering Primitive: The attacker provides crafted parameters or invokes specific system calls that exercise the vulnerable path in fs/smb/server/vfs_cache.c (ksmbd durable handle scavenger).
  3. Memory Corruption: VULNERABILITY: Scavenger thread holding fp pointer can race here because refcount wasn’t verified with kref_put_lock.
  4. Impact Realization: The corruption yields either instant denial of service (kernel panic, taking down mission-critical cloud instances) or elevation of privilege granting root access across container boundaries.

4. Forensic Detection, Artifacts & System Logs

Section titled “4. Forensic Detection, Artifacts & System Logs”

Security operations centers (SOC) and DFIR incident responders must leverage kernel crash analysis, system logs, and eBPF probes to detect exploitation attempts.

Kernel Ring Buffer (dmesg)

Inspect /var/log/dmesg or journalctl -k for crash signatures matching: BUG: unable to handle kernel paging request in ksmbd_durable_scavenger or general protection fault in __ksmbd_close_fd. Look for KASAN warnings or unhandled page faults in fs/smb/server/vfs_cache.c.

sigma_kernel_cve_2026_31718.yaml
title: Linux ksmbd Rapid SMB2 Durable Handle Churn and Close Race
id: cve-2026-31718
status: experimental
description: Detects kernel error signatures and abnormal syscall behaviors associated with CVE-2026-31718.
logsource:
category: kernel
product: linux
detection:
selection_dmesg:
- 'BUG:'
- 'fs'
condition: selection_dmesg
fields:
- Message
- Hostname
falsepositives:
- Hardware memory faults or unpatched test suites
level: high

Immediate remediation requires updating the Linux kernel to patched upstream releases and implementing defense-in-depth mitigations.

  1. Kernel Upgrade: Apply distribution security updates providing Linux kernel version 6.18.23 or backported patches from your vendor (RHEL, Ubuntu, Debian, SUSE).
  2. Subsystem Isolation: Where the affected subsystem is compiled as a loadable kernel module (.ko), blacklist the module if not strictly required in /etc/modprobe.d/blacklist.conf.
  3. Kernel Hardening: Ensure sysctl -w kernel.kptr_restrict=2 and sysctl -w kernel.dmesg_restrict=1 to prevent unprivileged pointer disclosure.
  4. Runtime Integrity: For comprehensive persistent threat hunting, consult our guide on Linux Authentication and Session Logging.