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

CVE-2026-31412: Linux Kernel Buffer Overflow Vulnerability

CVE-2026-31412 is a buffer overflow vulnerability in the Linux kernel's USB gadget f_mass_storage driver caused by unchecked integer overflow. This article covers the technical details, affected versions, impact, and mitigation.

Published: April 17, 2026

CVE-2026-31412 Overview

A potential integer overflow vulnerability has been discovered in the Linux kernel's USB gadget mass storage driver (f_mass_storage). The vulnerability exists in the check_command_size_in_blocks() function, which calculates data size in bytes by left shifting common->data_size_from_cmnd by the block size (common->curlun->blkbits). Without proper validation, this shift operation can cause an integer overflow, potentially leading to memory corruption or out-of-bounds memory access.

Critical Impact

A malicious USB host can send crafted SCSI READ or WRITE commands requesting large data sizes, causing the left shift operation to wrap around and bypass boundary checks, potentially leading to memory corruption or out-of-bounds accesses.

Affected Products

  • Linux kernel (USB gadget f_mass_storage driver)
  • Systems using the USB mass storage gadget functionality
  • Embedded devices implementing USB gadget mode

Discovery Timeline

  • 2026-04-10 - CVE CVE-2026-31412 published to NVD
  • 2026-04-13 - Last updated in NVD database

Technical Details for CVE-2026-31412

Vulnerability Analysis

The integer overflow vulnerability resides in the USB gadget mass storage driver's check_command_size_in_blocks() function within the Linux kernel. The core issue stems from the unsafe calculation of data size when processing SCSI commands from a USB host.

When the function calculates the data size in bytes, it performs a left shift operation on common->data_size_from_cmnd using the block size value stored in common->curlun->blkbits. The block size is initially configured in fsg_lun_open(), while common->data_size_from_cmnd is established in do_scsi_command(). Neither initialization includes validation to prevent integer overflow when these two values interact through the shift operation.

An attacker with physical access to a system acting as a USB device can exploit this by connecting the vulnerable system to a malicious USB host that sends specially crafted SCSI READ or WRITE commands with excessively large data size values. When the left shift operation overflows, the resulting truncated data size can bypass subsequent boundary validation checks, potentially causing memory corruption or unauthorized memory access.

Root Cause

The root cause is the absence of overflow checking when performing the left shift operation in check_command_size_in_blocks(). The function blindly shifts common->data_size_from_cmnd left by common->curlun->blkbits bits without verifying that the result will fit within the expected integer bounds. This is a classic integer overflow condition where the product of the calculation exceeds the maximum value representable by the data type.

Attack Vector

The attack requires physical access to exploit. An attacker must connect a vulnerable Linux system operating in USB gadget mode to a malicious USB host controller. The malicious host then issues SCSI commands (such as READ or WRITE operations) with carefully crafted parameters designed to trigger the integer overflow. When the overflow occurs, the truncated size value causes the driver to operate on incorrect memory boundaries, potentially allowing memory corruption or information disclosure.

The vulnerability is exploited through crafted SCSI command sequences sent via USB. The malicious host sends commands with large data_size_from_cmnd values that, when left-shifted by the block size bits, cause integer wraparound. The fix implemented in the kernel patches uses the check_shl_overflow() macro to safely perform the shift operation and detect any overflow conditions before proceeding with the calculation.

Detection Methods for CVE-2026-31412

Indicators of Compromise

  • Unexpected system crashes or kernel panics when USB gadget mode is active
  • Memory corruption errors in kernel logs related to f_mass_storage driver
  • Unusual SCSI command sequences in USB traffic when system is connected to external hosts

Detection Strategies

  • Monitor kernel logs for errors or warnings originating from the USB gadget subsystem
  • Implement USB traffic analysis to detect anomalous SCSI command patterns with unusually large data size parameters
  • Deploy kernel-level monitoring to detect out-of-bounds memory access attempts in the mass storage driver context

Monitoring Recommendations

  • Enable verbose logging for the USB gadget subsystem during debugging or high-security scenarios
  • Monitor system stability metrics when USB gadget functionality is in use
  • Implement endpoint detection solutions capable of identifying kernel-level memory corruption attempts

How to Mitigate CVE-2026-31412

Immediate Actions Required

  • Update to a patched Linux kernel version that includes the overflow check fix
  • If patching is not immediately possible, consider disabling USB gadget mass storage functionality if not required
  • Restrict physical access to systems operating in USB gadget mode

Patch Information

The Linux kernel maintainers have released patches to address this vulnerability by implementing the check_shl_overflow() macro to safely perform the shift operation and prevent integer overflow conditions. Multiple patch commits are available for different kernel branches:

  • Kernel Git Commit 228b379
  • Kernel Git Commit 3428dc5
  • Kernel Git Commit 387ebb0
  • Kernel Git Commit 8479891
  • Kernel Git Commit 91817ad
  • Kernel Git Commit ce0caae

Workarounds

  • Disable the USB gadget mass storage driver module (g_mass_storage or usb_f_mass_storage) if not required for operations
  • Implement physical security controls to prevent unauthorized USB host connections to vulnerable systems
  • Use application-level controls to restrict USB gadget functionality to trusted environments only
bash
# Disable USB mass storage gadget module if not needed
modprobe -r usb_f_mass_storage
# Blacklist the module to prevent automatic loading
echo "blacklist usb_f_mass_storage" >> /etc/modprobe.d/blacklist-usb-gadget.conf

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

  • Vulnerability Details
  • TypeBuffer Overflow

  • Vendor/TechLinux Kernel

  • SeverityNONE

  • CVSS ScoreN/A

  • EPSS Probability0.01%

  • Known ExploitedNo
  • Impact Assessment
  • ConfidentialityNone
  • IntegrityNone
  • AvailabilityNone
  • Technical References
  • Kernel Git Commit 228b379

  • Kernel Git Commit 3428dc5

  • Kernel Git Commit 387ebb0

  • Kernel Git Commit 8479891

  • Kernel Git Commit 91817ad

  • Kernel Git Commit ce0caae
  • Related CVEs
  • CVE-2026-31449: Linux Kernel Buffer Overflow Vulnerability

  • CVE-2026-31512: Linux Kernel Buffer Overflow Vulnerability

  • CVE-2026-31438: Linux Kernel Buffer Overflow Vulnerability

  • CVE-2026-31450: Linux Kernel Buffer Overflow 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