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

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

CVE-2026-31477 is a use-after-free vulnerability in Linux Kernel's ksmbd component that causes memory leaks and NULL pointer dereference. This post covers technical details, affected versions, impact, and mitigation.

Updated: May 16, 2026

CVE-2026-31477 Overview

CVE-2026-31477 is a vulnerability in the Linux kernel's ksmbd in-kernel SMB3 server. The flaw resides in the smb2_lock() function and includes three distinct error handling defects: two memory leak paths and one NULL pointer dereference [CWE-476]. After list_del() detaches smb_lock from lock_list at the no_check_cl label, several exit paths fail to free the detached object, and the rollback path unconditionally dereferences a pointer that smb_flock_init() may return as NULL on allocation failure. The vulnerability is reachable over the network through SMB2 lock requests handled by ksmbd.

Critical Impact

A remote attacker reaching an exposed ksmbd share can trigger a kernel NULL pointer dereference and trigger kernel memory leaks, leading to denial of service of the affected host.

Affected Products

  • Linux kernel 5.15 with ksmbd enabled
  • Linux kernel 7.0 release candidates rc1 through rc7
  • Distributions shipping ksmbd SMB server based on the affected kernel branches

Discovery Timeline

  • 2026-04-22 - CVE-2026-31477 published to NVD
  • 2026-04-27 - Last updated in NVD database

Technical Details for CVE-2026-31477

Vulnerability Analysis

The smb2_lock() function in fs/smb/server/smb2pdu.c processes SMB2 LOCK requests. After the no_check_cl label, list_del() detaches an smb_lock element from lock_list. The cleanup handler at the out: label only iterates lock_list and rollback_list, so any detached smb_lock that the function fails to free directly becomes leaked kernel memory along with its associated struct file_lock.

The NULL dereference occurs in the rollback path. When the kernel rolls back partially applied byte-range locks after a failure, it calls smb_flock_init() to allocate a new file_lock and immediately passes the result to vfs_lock_file() and locks_free_lock(). If allocation fails, the result is NULL and the kernel crashes.

Root Cause

The root cause is asymmetric resource management. The function detaches smb_lock from its tracking list without ensuring all subsequent error branches free the object. Two specific cases trigger leaks: an unexpected return from vfs_lock_file() in the non-UNLOCK path, and an -ENOENT return in the UNLOCK path. In the latter, the function also returns a stale error code to the SMB dispatcher. The third case is a missing NULL check on the return value of smb_flock_init() in the rollback loop.

Attack Vector

An unauthenticated or authenticated SMB client can send crafted SMB2 LOCK or UNLOCK requests against a ksmbd share to drive smb2_lock() into the affected error paths. Repeated requests exhaust kernel memory through the leaked smb_lock and file_lock structures. Triggering the rollback path under allocation pressure produces a kernel NULL pointer dereference and a kernel oops, causing the SMB server thread to crash and disrupting file service.

This vulnerability requires no user interaction and is exploitable over the network wherever ksmbd is exposed. Verified code examples are not publicly available; refer to the upstream commit messages in the Patch Information section for the precise call sequence.

Detection Methods for CVE-2026-31477

Indicators of Compromise

  • Kernel oops or panic messages referencing smb2_lock, smb_flock_init, vfs_lock_file, or locks_free_lock in dmesg and /var/log/kern.log.
  • Steady growth in kernel slab usage for file_lock_cache reported by slabtop on hosts running ksmbd.
  • Unexpected restarts or unresponsiveness of the ksmbd kernel threads alongside SMB client disconnects.

Detection Strategies

  • Monitor kernel logs for crash signatures that include BUG: kernel NULL pointer dereference with a call trace traversing smb2_lock.
  • Correlate spikes in SMB2 LOCK or UNLOCK request volume with kernel memory growth on file servers.
  • Audit installed kernel package versions against the fixed commits to identify systems still running affected builds.

Monitoring Recommendations

  • Track MemAvailable and Slab values from /proc/meminfo on ksmbd hosts and alert on sustained downward trends.
  • Capture and retain ksmbd server logs and SMB connection telemetry to attribute crashes to specific clients.
  • Enable kdump so that any smb2_lock-related panic produces a crash dump for forensic analysis.

How to Mitigate CVE-2026-31477

Immediate Actions Required

  • Apply the upstream stable kernel update that includes the smb2_lock() fix and reboot affected hosts.
  • Restrict network reachability of ksmbd shares to trusted client subnets using host or perimeter firewalls.
  • Disable the ksmbd module on systems that do not require an in-kernel SMB server until patches are installed.

Patch Information

The fix hoists locks_free_lock() and kfree() to a single shared free site in the UNLOCK branch, frees smb_lock and flock before goto out in the non-UNLOCK branch, propagates the correct error code, and wraps the rollback VFS unlock in an if (rlock) guard with a NULL check before locks_free_lock(rlock). The corrections are available in the following stable tree commits: Kernel Patch 309b44e, Kernel Patch 3cdacd1, Kernel Patch 91aeaa7, Kernel Patch aab42f0, Kernel Patch c9b95ef, and Kernel Patch cdac6f7.

Workarounds

  • Unload the ksmbd module with modprobe -r ksmbd and migrate file shares to a userspace SMB server such as Samba until the kernel is patched.
  • Block inbound TCP port 445 at the network edge and limit SMB exposure to authenticated VPN clients.
  • Enforce SMB signing and require authentication on ksmbd shares to reduce the population of clients able to reach the vulnerable code path.
bash
# Verify running kernel and unload ksmbd if not required
uname -r
sudo modprobe -r ksmbd
echo 'blacklist ksmbd' | sudo tee /etc/modprobe.d/disable-ksmbd.conf

# Restrict SMB to trusted sources while patching
sudo iptables -A INPUT -p tcp --dport 445 -s 10.0.0.0/8 -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

  • SeverityHIGH

  • CVSS Score7.5

  • EPSS Probability0.07%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityHigh
  • CWE References
  • CWE-476
  • Vendor Resources
  • Kernel Patch 309b44e

  • Kernel Patch 3cdacd1

  • Kernel Patch 91aeaa7

  • Kernel Patch aab42f0

  • Kernel Patch c9b95ef

  • Kernel Patch cdac6f7
  • 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