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-2021-38166

CVE-2021-38166: Linux Kernel Privilege Escalation Flaw

CVE-2021-38166 is a privilege escalation vulnerability in the Linux Kernel's BPF hashtab component that triggers integer overflow and out-of-bounds writes. This article covers technical details, affected versions, and mitigations.

Published: February 25, 2026

CVE-2021-38166 Overview

CVE-2021-38166 is an integer overflow and out-of-bounds write vulnerability in the Linux kernel's BPF (Berkeley Packet Filter) hashtable implementation. The vulnerability exists in kernel/bpf/hashtab.c and can be triggered when many elements are placed in a single bucket, potentially leading to memory corruption and local privilege escalation.

Critical Impact

Local attackers with limited privileges may exploit this integer overflow to achieve out-of-bounds memory writes, potentially escalating privileges or causing system instability. While exploitation may be impractical without CAP_SYS_ADMIN capability, the vulnerability affects multiple Linux distributions including Fedora and Debian.

Affected Products

  • Linux Kernel through version 5.13.8
  • Fedora 33 and Fedora 34
  • Debian Linux 11.0

Discovery Timeline

  • 2021-08-07 - CVE-2021-38166 published to NVD
  • 2024-11-21 - Last updated in NVD database

Technical Details for CVE-2021-38166

Vulnerability Analysis

This vulnerability stems from improper handling of integer arithmetic within the BPF hashtable subsystem of the Linux kernel. The BPF subsystem allows user-space programs to run sandboxed code in kernel space for various purposes including packet filtering, tracing, and performance monitoring. The hashtable implementation in kernel/bpf/hashtab.c contains a flaw where adding numerous elements to a single hash bucket can trigger an integer overflow condition.

When the bucket element count exceeds the maximum value that can be represented by the integer type used, the value wraps around, leading to incorrect bounds calculations. This subsequently enables out-of-bounds memory writes, corrupting adjacent kernel memory regions. The impact includes potential arbitrary code execution in kernel context, privilege escalation, and denial of service through kernel panic.

The vulnerability requires local access to the system, and the official CVE notes indicate that practical exploitation may require the CAP_SYS_ADMIN capability, which limits the attack surface to privileged local users or containers with elevated capabilities.

Root Cause

The root cause is an integer overflow vulnerability (CWE-190) in the BPF hashtable element counting mechanism. When calculating the number of elements in a hash bucket, the code fails to properly validate that the count does not exceed integer bounds before using it in subsequent memory operations. This arithmetic oversight allows attackers to manipulate the bucket state in ways that bypass intended memory safety checks.

Attack Vector

The attack vector is local, requiring an attacker to have user-level access to the target system. The attacker must be able to interact with the BPF subsystem, which may involve creating BPF maps and manipulating their contents. The attack flow involves:

  1. Creating a BPF hashtable map with specific parameters
  2. Inserting a large number of elements designed to hash to the same bucket
  3. Triggering the integer overflow condition through continued element insertion
  4. Exploiting the resulting out-of-bounds write to corrupt kernel memory

The vulnerability mechanism involves manipulating BPF hashtable bucket operations to trigger integer overflow conditions. When a large number of elements are inserted into a single bucket, the internal counter can overflow, leading to incorrect memory boundary calculations and subsequent out-of-bounds writes. For detailed technical analysis, refer to the BPF Mailing List Discussion and the Linux Kernel BPF Commit.

Detection Methods for CVE-2021-38166

Indicators of Compromise

  • Unusual BPF map creation activity with abnormally high element counts
  • Kernel log messages indicating memory corruption or BPF subsystem errors
  • Unexpected system crashes or kernel panics related to BPF operations
  • Suspicious processes attempting to create or manipulate BPF hashtable maps

Detection Strategies

  • Monitor for processes invoking BPF system calls with unusual parameters or frequencies
  • Implement audit rules to track BPF map creation and manipulation operations
  • Deploy kernel integrity monitoring to detect unexpected memory modifications
  • Use SentinelOne's behavioral AI to identify anomalous BPF-related activity patterns

Monitoring Recommendations

  • Enable kernel audit logging for BPF-related system calls (bpf() syscall)
  • Monitor system logs for kernel warnings related to BPF or memory subsystems
  • Track processes that request CAP_SYS_ADMIN or CAP_BPF capabilities
  • Implement real-time alerting on kernel crash events or BPF-related anomalies

How to Mitigate CVE-2021-38166

Immediate Actions Required

  • Update the Linux kernel to a patched version that addresses this vulnerability
  • Review and restrict CAP_SYS_ADMIN and CAP_BPF capability grants to only essential processes
  • Apply vendor-specific security patches from Fedora or Debian as applicable
  • Consider disabling unprivileged BPF access via kernel.unprivileged_bpf_disabled sysctl

Patch Information

The Linux kernel maintainers have released a fix for this vulnerability. The patch is available in the official kernel BPF git repository with commit ID c4eb1f403243fc7bbb7de644db8587c03de36da6. Users should update to kernel versions containing this fix.

Distribution-specific patches are available:

  • Debian Security Advisory DSA-4978
  • Fedora Package Announcements
  • NetApp Security Advisory

Workarounds

  • Disable unprivileged BPF access by setting kernel.unprivileged_bpf_disabled=1
  • Restrict access to BPF subsystem through AppArmor or SELinux policies
  • Limit CAP_SYS_ADMIN capability grants using capability bounding sets
  • Isolate untrusted workloads in containers without BPF capabilities
bash
# Disable unprivileged BPF access (temporary)
sysctl -w kernel.unprivileged_bpf_disabled=1

# Make the change persistent across reboots
echo "kernel.unprivileged_bpf_disabled = 1" >> /etc/sysctl.conf
sysctl -p

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

  • Vulnerability Details
  • TypePrivilege Escalation

  • Vendor/TechLinux Kernel

  • SeverityHIGH

  • CVSS Score7.8

  • EPSS Probability0.10%

  • 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-190
  • Technical References
  • Fedora Package Announcement

  • Fedora Package Announcement

  • BPF Mailing List Discussion

  • NetApp Security Advisory

  • Debian Security Advisory DSA-4978
  • Vendor Resources
  • Linux Kernel BPF Commit
  • Related CVEs
  • CVE-2026-31430: Linux Kernel Privilege Escalation Flaw

  • CVE-2026-31443: Linux Kernel Privilege Escalation Flaw

  • CVE-2026-31463: Linux Kernel Privilege Escalation Flaw

  • CVE-2026-31459: Linux Kernel Privilege Escalation Flaw
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