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-2024-36904

CVE-2024-36904: Linux Kernel Use-After-Free Vulnerability

CVE-2024-36904 is a use-after-free vulnerability in the Linux kernel's TCP TIME-WAIT socket handling that could trigger memory corruption. This article covers the technical details, affected versions, and mitigation strategies.

Published: January 28, 2026

CVE-2024-36904 Overview

CVE-2024-36904 is a use-after-free vulnerability in the Linux kernel's TCP implementation, specifically within the tcp_twsk_unique() function. The flaw arises from a race condition introduced by commit ec94c2696f0b ("tcp/dccp: avoid one atomic operation for timewait hashdance"), where inet_twsk_hashdance() sets a TIME-WAIT socket's sk_refcnt after placing it into the ehash and releasing the bucket lock. This creates a small race window where other threads could attempt to reuse the port during connect() and call sock_hold() on a TIME-WAIT socket with a zero reference count, leading to reference count corruption and subsequent use-after-free conditions.

Critical Impact

Local attackers with low privileges can exploit this race condition to trigger use-after-free memory corruption, potentially leading to privilege escalation, arbitrary code execution, or system crashes on affected Linux systems.

Affected Products

  • Linux Kernel (multiple versions including 6.9-rc1 through 6.9-rc7)
  • Debian Linux 10.0
  • Various Linux distributions shipping vulnerable kernel versions

Discovery Timeline

  • 2024-05-30 - CVE-2024-36904 published to NVD
  • 2026-01-22 - Last updated in NVD database

Technical Details for CVE-2024-36904

Vulnerability Analysis

This vulnerability is classified as CWE-416 (Use After Free). The root issue lies in the TCP/DCCP timewait socket handling code where an optimization to reduce atomic operations inadvertently created a dangerous race condition. When a TIME-WAIT socket is added to the established hash table (ehash), its reference count (sk_refcnt) is set after the bucket lock is released rather than before. This ordering allows concurrent threads executing connect() to observe the socket in the hash table while its reference count is still zero.

When tcp_twsk_unique() calls sock_hold() on this zero-refcount socket, it incorrectly increments the reference count. The subsequent sock_put() call causes a reference count underflow, which eventually leads to a use-after-free condition when the memory is accessed after being freed.

Root Cause

The vulnerability stems from an unsafe ordering of operations in inet_twsk_hashdance(). The function was modified to set the socket's reference count after inserting it into the hash table and releasing the bucket lock. This violates the principle that shared data structures should only contain fully-initialized objects. The race window, while small, is exploitable under high concurrency scenarios, particularly on systems with heavy TCP connection churn where port reuse is frequent.

Attack Vector

Exploitation requires local access to the system with the ability to create TCP connections. An attacker can trigger the race condition by rapidly initiating connections that attempt to reuse ports currently in the TIME-WAIT state. The attack involves:

  1. Creating multiple concurrent threads that establish and tear down TCP connections
  2. Timing connection attempts to hit the window where TIME-WAIT sockets have been added to ehash but not yet had their reference count set
  3. Triggering the sock_hold() call on a zero-refcount socket through tcp_twsk_unique()
  4. Observing the reference count underflow when sock_put() is called

The kernel warning message "refcount_t: addition on 0; use-after-free" indicates when this condition has been triggered, as captured in the stack trace showing the call path through tcp_twsk_unique(), __inet_check_established(), __inet_hash_connect(), and ultimately tcp_v4_connect().

Detection Methods for CVE-2024-36904

Indicators of Compromise

  • Kernel warning messages containing "refcount_t: addition on 0; use-after-free" in system logs
  • Stack traces in dmesg showing refcount_warn_saturate called from tcp_twsk_unique()
  • Unexpected system crashes or kernel panics during high TCP connection activity
  • Memory corruption symptoms manifesting as seemingly unrelated kernel crashes

Detection Strategies

  • Monitor kernel logs (dmesg, /var/log/kern.log) for refcount warning messages from lib/refcount.c
  • Deploy kernel tracing tools (ftrace, eBPF) to monitor tcp_twsk_unique() and sock_hold() call patterns
  • Implement SentinelOne's kernel-level monitoring to detect anomalous memory access patterns in TCP stack functions
  • Configure crash dump analysis to identify use-after-free signatures in kernel memory

Monitoring Recommendations

  • Enable kernel address sanitizer (KASAN) in development environments to catch use-after-free conditions early
  • Set up alerting on kernel panic events and analyze crash dumps for TCP stack involvement
  • Monitor for unusual patterns of TCP connection failures or socket errors that could indicate exploitation attempts
  • Use SentinelOne Singularity platform's behavioral AI to detect privilege escalation attempts following memory corruption

How to Mitigate CVE-2024-36904

Immediate Actions Required

  • Update the Linux kernel to a patched version that includes the fix using refcount_inc_not_zero() in tcp_twsk_unique()
  • Apply vendor-specific security updates from your Linux distribution
  • For systems that cannot be immediately updated, consider limiting local user access to reduce attack surface
  • Monitor systems for signs of exploitation while patches are being deployed

Patch Information

The fix modifies tcp_twsk_unique() to use refcount_inc_not_zero() instead of sock_hold(). This atomic operation safely checks if the reference count is non-zero before incrementing, returning false if the socket has a zero reference count. When the function returns false, port reuse is abandoned, preventing the use-after-free condition.

Multiple kernel patches have been released across stable branches:

  • Linux Kernel Commit 13ed7df
  • Linux Kernel Commit 1796ca9c
  • Linux Kernel Commit 1d9cf07
  • Linux Kernel Commit 27b0284
  • Linux Kernel Commit 517e32e
  • Linux Kernel Commit 6e48faa
  • Linux Kernel Commit 84546cc
  • Linux Kernel Commit f2db723

Debian users should refer to the Debian LTS Announcement for distribution-specific patches. NetApp customers should consult NetApp Security Advisory ntap-20240905-0004.

Workarounds

  • Reduce TCP connection concurrency in high-risk environments to minimize the race window
  • Implement network segmentation to limit which users can initiate TCP connections on vulnerable systems
  • Consider enabling SELinux or AppArmor policies to restrict local user capabilities for socket operations
  • Monitor and audit local user activities that involve high-frequency TCP connection establishment
bash
# Check current kernel version for vulnerability status
uname -r

# Check for available kernel updates (Debian/Ubuntu)
apt update && apt list --upgradable | grep linux-image

# Check for available kernel updates (RHEL/CentOS)
yum check-update kernel

# Monitor kernel logs for exploitation indicators
dmesg | grep -i "refcount_t: addition on 0"

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.24%

  • 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-416
  • Technical References
  • Debian LTS Announcement #19

  • Debian LTS Announcement #20

  • NetApp Security Advisory ntap-20240905-0004
  • Vendor Resources
  • Linux Kernel Commit 13ed7df

  • Linux Kernel Commit 1796ca9c

  • Linux Kernel Commit 1d9cf07

  • Linux Kernel Commit 27b0284

  • Linux Kernel Commit 517e32e

  • Linux Kernel Commit 6e48faa

  • Linux Kernel Commit 84546cc

  • Linux Kernel Commit f2db723
  • 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