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
    • 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-2022-24958

CVE-2022-24958: Linux Kernel Use-After-Free Vulnerability

CVE-2022-24958 is a use-after-free vulnerability in the Linux Kernel USB gadget subsystem that can lead to system instability. This article covers the technical details, affected versions, impact, and mitigation.

Published: February 17, 2026

CVE-2022-24958 Overview

A memory management vulnerability exists in the Linux kernel's USB gadget legacy driver (drivers/usb/gadget/legacy/inode.c) through version 5.16.8. The vulnerability arises from improper handling of dev->buf release operations, which can lead to memory corruption conditions. This flaw affects the USB gadget filesystem interface used for implementing USB device functionality on Linux systems.

Critical Impact

Local attackers with low privileges can exploit this memory mismanagement vulnerability to potentially achieve high impact on system confidentiality, integrity, and availability through memory corruption.

Affected Products

  • Linux Kernel (through version 5.16.8)
  • Fedora 34 and 35
  • Debian Linux 9.0
  • NetApp H300S, H500S, H700S Firmware
  • NetApp H300E, H500E, H700E Firmware
  • NetApp H410S and H410C Firmware

Discovery Timeline

  • February 11, 2022 - CVE-2022-24958 published to NVD
  • November 21, 2024 - Last updated in NVD database

Technical Details for CVE-2022-24958

Vulnerability Analysis

The vulnerability is classified under CWE-763 (Release of Invalid Pointer or Reference), indicating improper memory management in the USB gadget legacy driver. The flaw occurs in the drivers/usb/gadget/legacy/inode.c file where the kernel mishandles the release of the dev->buf buffer.

The vulnerability allows a local attacker with low-level privileges to exploit the memory handling flaw without requiring user interaction. Successful exploitation can result in high impact to confidentiality, integrity, and availability of the affected system. The issue specifically manifests during error handling paths where the buffer release and state management are not properly synchronized.

Root Cause

The root cause lies in improper synchronization and state management when releasing the dev->buf buffer in the USB gadget filesystem driver. Two specific issues were identified:

  1. When usb_gadget_probe_driver() fails, the code would free dev->buf and set it to NULL without proper lock synchronization, leading to potential race conditions.

  2. When handling an existing dev->buf, the code would free the newly allocated buffer (kbuf) but continue to the fail path while holding a spinlock, causing improper state transitions.

Attack Vector

The attack vector is local, requiring the attacker to have low-privilege access to the system. The attacker can trigger the vulnerability through interactions with the USB gadget filesystem interface. Due to the memory mismanagement, an attacker could potentially cause use-after-free conditions or other memory corruption scenarios that may lead to privilege escalation or denial of service.

c
// Patch 1: Proper lock handling when dev->buf already exists
// Source: https://github.com/torvalds/linux/commit/89f3594d0de58e8a57d92d497dea9fee3d4b9cda

 	spin_lock_irq (&dev->lock);
 	value = -EINVAL;
 	if (dev->buf) {
+		spin_unlock_irq(&dev->lock);
 		kfree(kbuf);
-		goto fail;
+		return value;
 	}
 	dev->buf = kbuf;
c
// Patch 2: Clear related members properly when goto fail
// Source: https://github.com/torvalds/linux/commit/501e38a5531efbd77d5c73c0ba838a889bfc1d74

 	value = usb_gadget_probe_driver(&gadgetfs_driver);
 	if (value != 0) {
-		kfree (dev->buf);
-		dev->buf = NULL;
+		spin_lock_irq(&dev->lock);
+		goto fail;
 	} else {
 		/* at this point "good" hardware has for the first time
 		 * let the USB the host see us.  alternatively, if users

Detection Methods for CVE-2022-24958

Indicators of Compromise

  • Unexpected kernel crashes or panics related to USB gadget subsystem
  • Memory corruption errors in kernel logs referencing gadgetfs or inode.c
  • Suspicious local privilege escalation attempts following USB gadget interactions

Detection Strategies

  • Monitor kernel logs for memory corruption or use-after-free errors in the USB gadget subsystem
  • Implement kernel address sanitizer (KASAN) to detect memory safety violations
  • Use kernel debugging tools to track dev->buf allocation and release patterns

Monitoring Recommendations

  • Enable kernel audit logging for USB gadget filesystem operations
  • Deploy SentinelOne Singularity platform for real-time kernel-level threat detection
  • Monitor for unusual privilege escalation attempts on systems with USB gadget functionality enabled

How to Mitigate CVE-2022-24958

Immediate Actions Required

  • Update the Linux kernel to a patched version (5.16.9 or later)
  • Apply vendor-specific patches from Fedora, Debian, or NetApp as applicable
  • Restrict access to USB gadget filesystem interfaces to trusted users only
  • Consider disabling USB gadget functionality if not required

Patch Information

The vulnerability has been addressed through two kernel commits that fix the memory management issues:

  1. Linux Kernel Commit 89f3594d0de58e8a57d92d497dea9fee3d4b9cda - Fixes the issue of releasing an existing dev->buf with proper lock handling
  2. Linux Kernel Commit 501e38a5531efbd77d5c73c0ba838a889bfc1d74 - Clears related members properly when going to fail path

Additional vendor advisories:

  • Debian LTS Announcement
  • NetApp Security Advisory

Workarounds

  • Disable the USB gadget legacy driver (gadgetfs) if not required for system functionality
  • Restrict access to /dev/gadget device files using filesystem permissions
  • Use Linux Security Modules (SELinux/AppArmor) to limit processes that can interact with USB gadget interfaces
bash
# Configuration example: Disable gadgetfs module loading
echo "blacklist gadgetfs" >> /etc/modprobe.d/blacklist.conf
echo "install gadgetfs /bin/false" >> /etc/modprobe.d/blacklist.conf
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

  • SeverityHIGH

  • CVSS Score7.8

  • EPSS Probability0.05%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityHigh
  • CWE References
  • CWE-763
  • Technical References
  • Debian LTS Announcement

  • Fedora Package Announcement

  • Fedora Package Announcement

  • NetApp Security Advisory
  • Vendor Resources
  • Linux Kernel Commit

  • GitHub Linux Commit

  • GitHub Linux Commit
  • 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