Join the Cyber Forum: Threat Intel on May 12, 2026 to learn how AI is reshaping threat defense.Join the Virtual Cyber Forum: Threat IntelRegister Now
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 the Linux kernel's ksmbd component that causes memory leaks and NULL pointer dereferences. This article covers technical details, affected versions, impact, and mitigation.

Published: April 23, 2026

CVE-2026-31477 Overview

A memory management vulnerability has been identified in the Linux kernel's ksmbd (kernel SMB server) module, specifically within the smb2_lock() function. This vulnerability involves multiple error handling issues that can result in memory leaks and a NULL pointer dereference condition. The flaw stems from improper memory management after list_del() detaches smb_lock from lock_list at the no_check_cl label, leading to three distinct error handling problems that can cause kernel stability issues.

Critical Impact

Exploitation of this vulnerability can lead to kernel memory leaks, resource exhaustion, and system crashes through NULL pointer dereference when processing SMB2 lock requests, potentially causing denial of service conditions on affected Linux systems running ksmbd.

Affected Products

  • Linux kernel with ksmbd module enabled
  • Systems using kernel SMB server functionality
  • Linux distributions with vulnerable kernel versions

Discovery Timeline

  • April 22, 2026 - CVE-2026-31477 published to NVD
  • April 23, 2026 - Last updated in NVD database

Technical Details for CVE-2026-31477

Vulnerability Analysis

The vulnerability exists in the smb2_lock() function within the ksmbd module, which handles SMB2 file locking operations. The function exhibits three distinct error handling failures that occur after the list_del() operation detaches smb_lock from lock_list at the no_check_cl label:

Issue 1: When vfs_lock_file() returns an unexpected error in the non-UNLOCK path, the goto out statement causes a memory leak. The out: handler only iterates through lock_list and rollback_list, neither of which contains the detached smb_lock structure, leaving it and its associated flock unfreed.

Issue 2: When vfs_lock_file() returns -ENOENT in the UNLOCK path, a similar memory leak occurs. Additionally, the error code returned to the dispatcher becomes stale, potentially masking the actual error condition.

Issue 3: During the rollback path, smb_flock_init() can return NULL on allocation failure. The code unconditionally dereferences this result, causing a kernel NULL pointer dereference and subsequent system crash. The vulnerability was discovered via call-graph analysis using sqry.

Root Cause

The root cause is improper error handling and memory management in the smb2_lock() function. After list_del() removes smb_lock from the linked list, the cleanup handlers at the out: label cannot properly free the detached memory structures because they only iterate through lock_list and rollback_list. Additionally, the code lacks NULL checks before dereferencing the return value of smb_flock_init() in the rollback path, creating a NULL pointer dereference condition.

Attack Vector

An attacker with network access to a system running ksmbd could potentially trigger these conditions by sending specially crafted SMB2 lock requests that cause the vulnerable code paths to execute. By inducing error conditions in the vfs_lock_file() function or triggering memory allocation failures during rollback operations, an attacker could cause progressive memory exhaustion through repeated exploitation or trigger an immediate kernel crash via the NULL pointer dereference.

The fix addresses these issues by hoisting locks_free_lock() and kfree() calls to execute before the if(!rc) check in the UNLOCK branch, ensuring all exit paths share a single free site. For the non-UNLOCK branch, smb_lock and flock are freed before the goto out statement. The rollback path now includes an if(rlock) guard and proper NULL check for locks_free_lock(rlock) in the shared cleanup section.

Detection Methods for CVE-2026-31477

Indicators of Compromise

  • Unexpected kernel panics or system crashes with NULL pointer dereference in ksmbd module stack traces
  • Progressive memory consumption on systems running ksmbd without corresponding SMB activity increases
  • Kernel log entries showing errors in smb2_lock() or related ksmbd functions
  • System instability following heavy SMB2 file locking operations

Detection Strategies

  • Monitor kernel logs for NULL pointer dereference errors with smb2_lock or ksmbd-related function names in the call stack
  • Implement memory monitoring to detect abnormal kernel memory growth patterns on systems running ksmbd
  • Deploy SentinelOne Singularity platform for real-time kernel-level threat detection and anomaly identification
  • Use crash dump analysis tools to identify ksmbd-related kernel panics

Monitoring Recommendations

  • Enable kernel auditing for ksmbd module operations and memory allocation failures
  • Configure alerting on ksmbd service crashes or unexpected restarts
  • Monitor /var/log/kern.log and dmesg output for memory allocation failures in ksmbd context
  • Implement baseline memory usage monitoring for systems running kernel SMB services

How to Mitigate CVE-2026-31477

Immediate Actions Required

  • Update the Linux kernel to a patched version that includes the memory leak and NULL dereference fixes
  • If ksmbd is not required, disable the module to eliminate the attack surface
  • Restrict network access to SMB services to trusted hosts and networks only
  • Monitor affected systems for signs of exploitation or unusual memory consumption

Patch Information

The Linux kernel maintainers have released patches to address this vulnerability. Multiple commits have been backported to stable kernel branches:

  • Linux Kernel Commit 309b44e
  • Linux Kernel Commit 3cdacd1
  • Linux Kernel Commit 91aeaa7
  • Linux Kernel Commit aab42f0
  • Linux Kernel Commit c9b95ef
  • Linux Kernel Commit cdac6f7

Apply the appropriate patch for your kernel version by updating through your distribution's package manager or by compiling an updated kernel from source.

Workarounds

  • Disable the ksmbd module if kernel-based SMB server functionality is not required: modprobe -r ksmbd
  • Blacklist the ksmbd module to prevent automatic loading on system boot
  • Use userspace Samba server instead of ksmbd for SMB file sharing needs
  • Implement network-level access controls to limit SMB service exposure to trusted networks
bash
# Disable and blacklist ksmbd module
sudo modprobe -r ksmbd
echo "blacklist ksmbd" | sudo tee /etc/modprobe.d/ksmbd-blacklist.conf
sudo update-initramfs -u

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

  • SeverityNONE

  • CVSS ScoreN/A

  • EPSS Probability0.02%

  • Known ExploitedNo
  • Impact Assessment
  • ConfidentialityNone
  • IntegrityNone
  • AvailabilityNone
  • Technical References
  • Linux Kernel Commit 309b44e

  • Linux Kernel Commit 3cdacd1

  • Linux Kernel Commit 91aeaa7

  • Linux Kernel Commit aab42f0

  • Linux Kernel Commit c9b95ef

  • Linux Kernel Commit cdac6f7
  • Related CVEs
  • CVE-2026-31475: Linux Kernel Use-After-Free Vulnerability

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

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

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

Experience the World’s Most Advanced Cybersecurity Platform

See how our intelligent, autonomous cybersecurity platform can protect your organization now 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