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
    • 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-2023-40791

CVE-2023-40791: Linux Kernel Use-After-Free Vulnerability

CVE-2023-40791 is a use-after-free vulnerability in Linux Kernel's scatterlist.c affecting versions before 6.4.12. This article covers the technical details, affected versions, security impact, and mitigation strategies.

Published: February 11, 2026

CVE-2023-40791 Overview

A memory management vulnerability exists in the Linux kernel's extract_user_to_sg function located in lib/scatterlist.c. In versions prior to 6.4.12, the function fails to properly unpin pages under certain conditions, leading to memory leaks and potential system instability. This issue is demonstrated by a WARNING message generated for try_grab_page, indicating improper handling of pinned user pages in the scatterlist memory management subsystem.

Critical Impact

Local attackers with low privileges could exploit this page unpinning failure to cause integrity and availability impacts through memory exhaustion or corruption scenarios.

Affected Products

  • Linux Kernel (versions prior to 6.4.12)
  • NetApp H300S/H300S Firmware
  • NetApp H500S/H500S Firmware
  • NetApp H700S/H700S Firmware
  • NetApp H410S/H410S Firmware

Discovery Timeline

  • 2023-10-16 - CVE CVE-2023-40791 published to NVD
  • 2024-11-21 - Last updated in NVD database

Technical Details for CVE-2023-40791

Vulnerability Analysis

The vulnerability resides in the kernel's scatterlist memory management code, specifically within the extract_user_to_sg function. This function is responsible for handling user-space memory pages and mapping them into scatter-gather lists for efficient I/O operations. The flaw occurs when the function encounters an error condition but fails to properly release (unpin) the memory pages that were previously pinned.

When user pages are pinned for DMA or other I/O operations, the kernel increases a reference count to prevent those pages from being freed or swapped out. If these pages are not properly unpinned when an error occurs, the reference counts remain elevated, preventing proper memory reclamation. Over time, this can lead to memory exhaustion as pages accumulate without being properly released.

The vulnerability requires local access and elevated complexity to exploit, but an authenticated attacker could potentially trigger the error condition repeatedly to exhaust system memory resources or cause data integrity issues.

Root Cause

The root cause stems from incomplete error handling in the extract_user_to_sg function. When constructing a scatterlist from user-space memory, the function pins pages into memory to ensure they remain available during I/O operations. However, in certain failure paths, the cleanup code does not properly iterate through and unpin all previously pinned pages before returning an error. This results in orphaned page pins that persist beyond their intended lifetime, manifesting as the try_grab_page warning observed in kernel logs.

Attack Vector

The attack vector is local, requiring an authenticated user with low privileges to interact with kernel subsystems that utilize scatterlist operations. The attacker would need to craft specific operations that trigger the vulnerable code path in extract_user_to_sg, causing the function to fail after pinning pages but before the scatterlist is fully constructed. By repeatedly triggering this condition, an attacker could gradually exhaust system memory or cause integrity issues.

The vulnerability mechanism involves:

  1. A local user initiates an operation that requires scatterlist construction from user memory
  2. The extract_user_to_sg function begins pinning user pages
  3. An error condition is encountered mid-operation
  4. The error handling path fails to unpin the already-pinned pages
  5. Memory reference counts remain elevated, preventing proper page reclamation

For detailed technical analysis, refer to the Linux Kernel Commit f443fd5 and the Linux Crypto Discussion Thread.

Detection Methods for CVE-2023-40791

Indicators of Compromise

  • Kernel warning messages related to try_grab_page in system logs
  • Unexplained memory pressure or gradual memory exhaustion on systems
  • Elevated page reference counts visible in memory debugging tools
  • System instability or performance degradation over time without apparent cause

Detection Strategies

  • Monitor kernel logs (dmesg or /var/log/kern.log) for WARNING messages containing try_grab_page or extract_user_to_sg
  • Implement memory monitoring to detect abnormal pinned page accumulation over time
  • Use kernel memory debugging tools such as kmemleak to identify unreleased page references
  • Deploy SentinelOne Singularity platform for real-time kernel-level threat detection and anomaly monitoring

Monitoring Recommendations

  • Enable kernel memory debugging options during testing to identify page leak patterns
  • Configure alerting for unusual memory consumption patterns on affected systems
  • Regularly review kernel version deployment across infrastructure to identify unpatched systems
  • Implement centralized log aggregation to correlate try_grab_page warnings across multiple hosts

How to Mitigate CVE-2023-40791

Immediate Actions Required

  • Update Linux kernel to version 6.4.12 or later on all affected systems
  • Review and update NetApp H-series firmware to patched versions as per NetApp Security Advisory ntap-20231110-0009
  • Prioritize patching for systems running crypto or I/O-intensive workloads that heavily utilize scatterlist operations
  • Monitor affected systems for signs of memory exhaustion until patches are applied

Patch Information

The vulnerability is resolved in Linux kernel version 6.4.12 through commit f443fd5af5dbd531f880d3645d5dd36976cf087f. This patch ensures that all pinned pages are properly unpinned during error conditions in the extract_user_to_sg function. The fix implements proper cleanup logic that iterates through pinned pages and releases them before returning error conditions.

For detailed patch information, see the Linux Kernel Change Log 6.4.12 and the Linux Kernel Commit f443fd5.

Workarounds

  • Limit local user access to systems running vulnerable kernel versions where possible
  • Implement resource quotas and memory limits through cgroups to contain potential memory exhaustion attacks
  • Increase system monitoring and alerting thresholds for memory-related anomalies
  • Consider isolating workloads that heavily utilize scatter-gather I/O operations
bash
# Check current kernel version
uname -r

# Verify if system is running patched kernel (6.4.12 or later)
if [[ $(uname -r | cut -d. -f1-3) < "6.4.12" ]]; then
    echo "WARNING: System may be vulnerable to CVE-2023-40791"
    echo "Current kernel: $(uname -r)"
    echo "Recommended: Update to kernel 6.4.12 or later"
fi

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

  • SeverityMEDIUM

  • CVSS Score6.3

  • EPSS Probability0.04%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:H/A:H
  • Impact Assessment
  • ConfidentialityHigh
  • IntegrityNone
  • AvailabilityHigh
  • CWE References
  • NVD-CWE-noinfo
  • Technical References
  • Linux Kernel Change Log 6.4.12

  • LKML Message August 3, 2023

  • NetApp Security Advisory ntap-20231110-0009
  • Vendor Resources
  • Linux Kernel Commit f443fd5

  • Linux Crypto Discussion Thread
  • Related CVEs
  • CVE-2026-23462: Linux Kernel Use-After-Free Vulnerability

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

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

  • CVE-2026-23456: 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