The SentinelOne Annual Threat Report - A Defenders Guide from the FrontlinesThe SentinelOne Annual Threat ReportGet the Report
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI for Security
      Leading the Way in AI-Powered Security Solutions
    • Securing AI
      Accelerate AI Adoption with Secure AI Tools, Apps, and Agents.
    • How It Works
      The Singularity XDR Difference
    • Singularity Marketplace
      One-Click Integrations to Unlock the Power of XDR
    • Pricing & Packaging
      Comparisons and Guidance at a Glance
    Data & AI
    • Purple AI
      Accelerate SecOps with Generative AI
    • Singularity Hyperautomation
      Easily Automate Security Processes
    • AI-SIEM
      The AI SIEM for the Autonomous SOC
    • AI Data Pipelines
      Security Data Pipeline for AI SIEM and Data Optimization
    • Singularity Data Lake
      AI-Powered, Unified Data Lake
    • Singularity Data Lake for Log Analytics
      Seamlessly Ingest Data from On-Prem, Cloud or Hybrid Environments
    Endpoint Security
    • Singularity Endpoint
      Autonomous Prevention, Detection, and Response
    • Singularity XDR
      Native & Open Protection, Detection, and Response
    • Singularity RemoteOps Forensics
      Orchestrate Forensics at Scale
    • Singularity Threat Intelligence
      Comprehensive Adversary Intelligence
    • Singularity Vulnerability Management
      Application & OS Vulnerability Management
    • Singularity Identity
      Identity Threat Detection and Response
    Cloud Security
    • Singularity Cloud Security
      Block Attacks with an AI-Powered CNAPP
    • Singularity Cloud Native Security
      Secure Cloud and Development Resources
    • Singularity Cloud Workload Security
      Real-Time Cloud Workload Protection Platform
    • Singularity Cloud Data Security
      AI-Powered Threat Detection for Cloud Storage
    • Singularity Cloud Security Posture Management
      Detect and Remediate Cloud Misconfigurations
    Securing AI
    • Prompt Security
      Secure AI Tools Across Your Enterprise
  • Why SentinelOne?
    Why SentinelOne?
    • Why SentinelOne?
      Cybersecurity Built for What’s Next
    • Our Customers
      Trusted by the World’s Leading Enterprises
    • Industry Recognition
      Tested and Proven by the Experts
    • About Us
      The Industry Leader in Autonomous Cybersecurity
    Compare SentinelOne
    • Arctic Wolf
    • Broadcom
    • CrowdStrike
    • Cybereason
    • Microsoft
    • Palo Alto Networks
    • Sophos
    • Splunk
    • Trellix
    • Trend Micro
    • Wiz
    Verticals
    • Energy
    • Federal Government
    • Finance
    • Healthcare
    • Higher Education
    • K-12 Education
    • Manufacturing
    • Retail
    • State and Local Government
  • Services
    Managed Services
    • Managed Services Overview
      Wayfinder Threat Detection & Response
    • Threat Hunting
      World-Class Expertise and Threat Intelligence
    • Managed Detection & Response
      24/7/365 Expert MDR Across Your Entire Environment
    • Incident Readiness & Response
      DFIR, Breach Readiness, & Compromise Assessments
    Support, Deployment, & Health
    • Technical Account Management
      Customer Success with Personalized Service
    • SentinelOne GO
      Guided Onboarding & Deployment Advisory
    • SentinelOne University
      Live and On-Demand Training
    • Services Overview
      Comprehensive Solutions for Seamless Security Operations
    • SentinelOne Community
      Community Login
  • Partners
    Our Network
    • MSSP Partners
      Succeed Faster with SentinelOne
    • Singularity Marketplace
      Extend the Power of S1 Technology
    • Cyber Risk Partners
      Enlist Pro Response and Advisory Teams
    • Technology Alliances
      Integrated, Enterprise-Scale Solutions
    • SentinelOne for AWS
      Hosted in AWS Regions Around the World
    • Channel Partners
      Deliver the Right Solutions, Together
    • SentinelOne for Google Cloud
      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale
    • Partner Locator
      Your Go-to Source for Our Top Partners in Your Region
    Partner Portal→
  • Resources
    Resource Center
    • Case Studies
    • Data Sheets
    • eBooks
    • Reports
    • Videos
    • Webinars
    • Whitepapers
    • Events
    View All Resources→
    Blog
    • Feature Spotlight
    • For CISO/CIO
    • From the Front Lines
    • Identity
    • Cloud
    • macOS
    • SentinelOne Blog
    Blog→
    Tech Resources
    • SentinelLABS
    • Ransomware Anthology
    • Cybersecurity 101
  • About
    About SentinelOne
    • About SentinelOne
      The Industry Leader in Cybersecurity
    • Investor Relations
      Financial Information & Events
    • SentinelLABS
      Threat Research for the Modern Threat Hunter
    • Careers
      The Latest Job Opportunities
    • Press & News
      Company Announcements
    • Cybersecurity Blog
      The Latest Cybersecurity Threats, News, & More
    • FAQ
      Get Answers to Our Most Frequently Asked Questions
    • DataSet
      The Live Data Platform
    • S Foundation
      Securing a Safer Future for All
    • S Ventures
      Investing in the Next Generation of Security, Data and AI
  • Pricing
Get StartedContact Us
CVE Vulnerability Database
Vulnerability Database/CVE-2026-31718

CVE-2026-31718: Linux Kernel Use-After-Free Vulnerability

CVE-2026-31718 is a use-after-free flaw in Linux Kernel's ksmbd durable scavenger that occurs during session disconnect. This post covers the technical details, affected versions, impact, and mitigation strategies.

Published: May 7, 2026

CVE-2026-31718 Overview

CVE-2026-31718 is a use-after-free vulnerability [CWE-416] in the Linux kernel's ksmbd in-kernel SMB3 server. The flaw resides in __ksmbd_close_fd() and is triggered through the durable file handle scavenger thread. When a durable handle survives a TCP disconnect without an SMB2_LOGOFF, session_fd_check() nulls fp->conn to preserve the handle, but leaves byte-range lock entries dangling on the freed connection's lock_list. The scavenger thread later dereferences this stale state, causing a slab use-after-free in kernel memory.

Critical Impact

Remote attackers reachable on an SMB port can trigger kernel memory corruption without authentication, leading to denial of service or potential remote code execution in kernel context.

Affected Products

  • Linux Kernel (multiple stable branches with ksmbd enabled)
  • Linux Kernel 7.1-rc1
  • Systems exposing ksmbd SMB3 file shares with durable handle support

Discovery Timeline

  • 2026-05-01 - CVE-2026-31718 published to NVD
  • 2026-05-06 - Last updated in NVD database

Technical Details for CVE-2026-31718

Vulnerability Analysis

The vulnerability is a use-after-free [CWE-416] in the ksmbd kernel module, which implements the SMB3 protocol server in-kernel. SMB3 supports durable file handles, allowing a client to reconnect after transient network loss without losing open file state. When a TCP session drops without a clean SMB2_LOGOFF, ksmbd attempts to keep the file pointer (fp) alive for later reconnection.

During this preservation step, session_fd_check() sets fp->conn = NULL and ksmbd_tcp_disconnect() frees the original ksmbd_conn object. However, byte-range lock entries on fp->lock_list remain linked into the freed connection's conn->lock_list through their smb_lock->clist field. The cleanup is asymmetric: the connection pointer is cleared, but the lock list membership is not.

The durable scavenger thread enforces a timeout for unreclaimed durable handles. When it fires, it calls __ksmbd_close_fd(NULL, fp), which iterates fp->lock_list and executes spin_lock(&fp->conn->llist_lock). Because fp->conn is NULL and the original connection has been freed, this both dereferences a null pointer and reaches into freed slab memory, producing the use-after-free condition.

Root Cause

The root cause is asymmetric cleanup of smb_lock->clist across the durable handle lifecycle. Three code paths must agree on lock-list ownership: the close path, session_fd_check(), and ksmbd_reopen_durable_fd(). The original code only nulled fp->conn without removing the lock entries from the connection's lock_list, leaving stale pointers into freed memory.

Attack Vector

The attack vector is network-based and requires no authentication or user interaction. An attacker reachable on TCP port 445 of a ksmbd-enabled host can open a file with a durable handle, acquire byte-range locks via SMB2 LOCK requests, then abruptly drop the TCP connection without sending SMB2_LOGOFF. After the durable scavenger timeout elapses, the kernel triggers the use-after-free during cleanup. Successful exploitation can corrupt kernel slab memory, leading to denial of service or escalation toward kernel code execution.

No public proof-of-concept exploit is currently listed for CVE-2026-31718, and the vulnerability is not present in the CISA Known Exploited Vulnerabilities catalog. The fix is described across upstream stable commits 235e3232, 3d668272, b34fc42c, and e33c65f0.

Detection Methods for CVE-2026-31718

Indicators of Compromise

  • Kernel oops, KASAN reports, or general protection fault traces referencing __ksmbd_close_fd, ksmbd_durable_scavenger, or smb_lock.
  • Unexpected ksmbd worker thread crashes correlated with abrupt SMB client TCP resets.
  • Repeated SMB2 CREATE requests with DH2Q durable handle context followed by half-open TCP teardowns from the same source.

Detection Strategies

  • Enable KASAN on test or canary kernels running ksmbd to catch use-after-free conditions in lock_list traversal before production impact.
  • Hunt for SMB2 sessions that establish durable handles, hold byte-range locks, and terminate without SMB2_LOGOFF within the durable timeout window.
  • Monitor dmesg and /var/log/kern.log for stack traces containing ksmbd_conn, llist_lock, or __ksmbd_close_fd.

Monitoring Recommendations

  • Centralize kernel logs from all ksmbd hosts and alert on segfaults or panics in SMB code paths.
  • Track per-source SMB connection churn; high rates of abrupt resets against shares with durable handles warrant investigation.
  • Audit ksmbd process restarts and kernel module reloads as potential post-crash recovery indicators.

How to Mitigate CVE-2026-31718

Immediate Actions Required

  • Apply the upstream stable kernel patches referenced by commits 235e3232, 3d668272, b34fc42c, and e33c65f0 from your distribution vendor.
  • If patching is not yet possible, restrict TCP/445 exposure to trusted management networks using host or perimeter firewalls.
  • Disable the ksmbd module on hosts that do not require an in-kernel SMB server and use samba user-space or no SMB service at all.

Patch Information

The fix corrects the asymmetric cleanup by safely skipping clist deletion when the list is empty and fp->conn is NULL, removing the lock from the old connection's lock_list in session_fd_check(), and re-adding the lock to the new connection's lock_list in ksmbd_reopen_durable_fd(). Patches are available at the Kernel Git Commit 235e323, Kernel Git Commit 3d66827, Kernel Git Commit b34fc42, and Kernel Git Commit e33c65f.

Workarounds

  • Unload the ksmbd module with modprobe -r ksmbd on systems that do not actively serve SMB shares.
  • Block inbound TCP/445 from untrusted networks at the host firewall until kernels are patched.
  • Where SMB is required, migrate temporarily to user-space samba, which is not affected by this ksmbd-specific defect.
bash
# Configuration example: blocklist ksmbd and restrict SMB exposure
echo 'blacklist ksmbd' | sudo tee /etc/modprobe.d/disable-ksmbd.conf
sudo modprobe -r ksmbd 2>/dev/null || true

# Restrict SMB to a trusted management subnet
sudo iptables -A INPUT -p tcp --dport 445 -s 10.0.0.0/24 -j ACCEPT
sudo iptables -A INPUT -p tcp --dport 445 -j DROP

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

  • Vulnerability Details
  • TypeUse After Free

  • Vendor/TechLinux Kernel

  • SeverityCRITICAL

  • CVSS Score9.8

  • EPSS Probability0.06%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityHigh
  • CWE References
  • CWE-416
  • Vendor Resources
  • Kernel Git Commit 235e323

  • Kernel Git Commit 3d66827

  • Kernel Git Commit b34fc42

  • Kernel Git Commit e33c65f
  • Related CVEs
  • CVE-2026-43328: Linux Kernel Use-After-Free Vulnerability

  • CVE-2026-43500: Linux Kernel Use-After-Free Vulnerability

  • CVE-2026-43333: Linux Kernel Use-After-Free Vulnerability

  • CVE-2026-43335: Linux Kernel Use-After-Free Vulnerability
Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.

Try SentinelOne
  • Get Started
  • Get a Demo
  • Product Tour
  • Why SentinelOne
  • Pricing & Packaging
  • FAQ
  • Contact
  • Contact Us
  • Customer Support
  • SentinelOne Status
  • Language
  • Platform
  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Services
  • Wayfinder TDR
  • SentinelOne GO
  • Technical Account Management
  • Support Services
  • Verticals
  • Energy
  • Federal Government
  • Finance
  • Healthcare
  • Higher Education
  • K-12 Education
  • Manufacturing
  • Retail
  • State and Local Government
  • Cybersecurity for SMB
  • Resources
  • Blog
  • Labs
  • Case Studies
  • Videos
  • Product Tours
  • Events
  • Cybersecurity 101
  • eBooks
  • Webinars
  • Whitepapers
  • Press
  • News
  • Ransomware Anthology
  • Company
  • About Us
  • Our Customers
  • Careers
  • Partners
  • Legal & Compliance
  • Security & Compliance
  • Investor Relations
  • S Foundation
  • S Ventures

©2026 SentinelOne, All Rights Reserved.

Privacy Notice Terms of Use

English