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

CVE-2021-41864: Linux Kernel Privilege Escalation Flaw

CVE-2021-41864 is a privilege escalation vulnerability in the Linux Kernel's eBPF stackmap component. Unprivileged users can exploit this flaw to trigger integer overflow. This article covers technical details, affected versions, security impact, and mitigation strategies.

Published: February 25, 2026

CVE-2021-41864 Overview

CVE-2021-41864 is an integer overflow vulnerability in the Linux kernel's eBPF subsystem, specifically within the prealloc_elems_and_freelist function in kernel/bpf/stackmap.c. This vulnerability affects Linux kernel versions prior to 5.14.12 and allows unprivileged users to trigger an eBPF multiplication integer overflow, resulting in an out-of-bounds write condition that could lead to privilege escalation or arbitrary code execution.

Critical Impact

Unprivileged local users can exploit this integer overflow to achieve out-of-bounds memory writes, potentially leading to kernel-level privilege escalation and full system compromise.

Affected Products

  • Linux Kernel (versions before 5.14.12)
  • Fedora 33, 34, and 35
  • Debian Linux 9.0 and 10.0
  • NetApp Cloud Backup
  • NetApp HCI Management Node
  • NetApp SolidFire
  • NetApp H-Series Firmware (H410C, H300S, H500S, H700S, H300E, H500E, H700E, H410S)
  • NetApp SolidFire Baseboard Management Controller

Discovery Timeline

  • October 2, 2021 - CVE-2021-41864 published to NVD
  • November 21, 2024 - Last updated in NVD database

Technical Details for CVE-2021-41864

Vulnerability Analysis

The vulnerability resides in the prealloc_elems_and_freelist() function within the BPF stack map implementation. This function is responsible for pre-allocating elements and managing the freelist for BPF stack maps. The core issue stems from an arithmetic operation where the element size calculation uses a 32-bit unsigned integer (u32) to store the result of a multiplication that can exceed 32-bit bounds.

When computing the total allocation size by multiplying elem_size with smap->map.max_entries, the intermediate result can overflow the 32-bit integer boundary. This overflow causes a significantly smaller memory region to be allocated than what the kernel believes it has, creating a classic heap-based out-of-bounds write scenario when subsequent operations write beyond the allocated buffer.

Root Cause

The root cause is a type mismatch in the element size calculation. The vulnerable code declares elem_size as a u32 (32-bit unsigned integer):

c
u32 elem_size = sizeof(struct stack_map_bucket) + smap->map.value_size;

When smap->map.value_size is a large user-controlled value, the subsequent multiplication with max_entries during memory allocation can wrap around, resulting in a much smaller allocation than intended. This is classified as CWE-190 (Integer Overflow or Wraparound).

Attack Vector

The attack vector requires local access to the system. An unprivileged user with access to the BPF subsystem can craft a malicious BPF program that creates a stack map with carefully chosen value_size and max_entries parameters designed to trigger the integer overflow. The attacker manipulates these values to cause the allocation function to allocate a small buffer while the kernel believes it has allocated a much larger one. Subsequent writes to this buffer exceed its boundaries, potentially corrupting adjacent kernel memory structures and enabling privilege escalation.

c
// Security patch - Source: kernel/bpf/stackmap.c
// Before the fix, elem_size was declared as u32, causing potential overflow

static int prealloc_elems_and_freelist(struct bpf_stack_map *smap)
{
-	u32 elem_size = sizeof(struct stack_map_bucket) + smap->map.value_size;
+	u64 elem_size = sizeof(struct stack_map_bucket) +
+			(u64)smap->map.value_size;
 	int err;

 	smap->elems = bpf_map_area_alloc(elem_size * smap->map.max_entries,

Source: Linux Kernel Commit

The fix changes the elem_size variable from u32 to u64 and explicitly casts smap->map.value_size to u64 before the addition, ensuring the calculation uses 64-bit arithmetic and preventing the overflow condition.

Detection Methods for CVE-2021-41864

Indicators of Compromise

  • Unusual BPF program loading activity by unprivileged users
  • Kernel crashes or panics related to memory corruption in BPF subsystem
  • Unexpected privilege escalation events following BPF-related system calls
  • Abnormal memory allocation patterns in kernel logs referencing stackmap.c

Detection Strategies

  • Monitor bpf() system calls for suspicious stack map creation with abnormally large value_size or max_entries parameters
  • Deploy kernel integrity monitoring tools to detect unauthorized kernel memory modifications
  • Enable and analyze auditd rules for BPF-related syscalls (bpf, perf_event_open)
  • Utilize SIEM correlation rules to identify patterns of BPF activity followed by privilege changes

Monitoring Recommendations

  • Enable kernel BPF audit logging via kernel.bpf_stats_enabled sysctl parameter
  • Implement real-time monitoring of /sys/kernel/debug/tracing/trace_pipe for BPF-related events
  • Configure alerting for kernel oops or panics mentioning bpf_stack_map or prealloc_elems
  • Deploy endpoint detection solutions capable of monitoring kernel-level memory operations

How to Mitigate CVE-2021-41864

Immediate Actions Required

  • Upgrade the Linux kernel to version 5.14.12 or later immediately
  • Apply vendor-specific security patches from Debian, Fedora, or NetApp as applicable
  • Restrict unprivileged BPF access by setting kernel.unprivileged_bpf_disabled=1
  • Audit systems for signs of exploitation prior to patching

Patch Information

The vulnerability was addressed in Linux kernel version 5.14.12. The fix modifies the prealloc_elems_and_freelist() function to use 64-bit arithmetic for the element size calculation, preventing the integer overflow. The patch is available through the Linux Kernel ChangeLog 5.14.12 and the specific commit can be reviewed at the BPF Git Repository.

Distribution-specific patches are available:

  • Debian Security Advisory DSA-5096
  • NetApp Security Advisory NTAP-20211029-0004

Workarounds

  • Disable unprivileged BPF by setting the sysctl parameter kernel.unprivileged_bpf_disabled=1
  • Implement seccomp filters to restrict bpf() syscall access for untrusted processes
  • Use SELinux or AppArmor policies to limit BPF capabilities to authorized services only
  • Consider network segmentation to limit access to systems running vulnerable kernel versions
bash
# Disable unprivileged BPF access as a temporary mitigation
echo 1 > /proc/sys/kernel/unprivileged_bpf_disabled

# Make the setting persistent across reboots
echo "kernel.unprivileged_bpf_disabled = 1" >> /etc/sysctl.d/99-bpf-hardening.conf
sysctl -p /etc/sysctl.d/99-bpf-hardening.conf

# Verify the setting is applied
sysctl kernel.unprivileged_bpf_disabled

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

  • SeverityHIGH

  • CVSS Score7.8

  • EPSS Probability0.03%

  • 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
  • Debian LTS Advisory December 2021

  • Debian LTS Advisory March 2022

  • Fedora Package Announcement

  • Fedora Package Announcement

  • Fedora Package Announcement

  • NetApp Security Advisory NTAP-20211029-0004

  • Debian DSA-5096 Security Notice
  • Vendor Resources
  • Linux Kernel ChangeLog 5.14.12

  • BPF Commit Change Log

  • Linux Commit Reference
  • Related CVEs
  • CVE-2026-23253: Linux Kernel Privilege Escalation Flaw

  • CVE-2020-14381: Linux Kernel Privilege Escalation Flaw

  • CVE-2026-22997: Linux Kernel J1939 Privilege Escalation

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