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
    • 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-29657

CVE-2021-29657: Linux Kernel Use-After-Free Vulnerability

CVE-2021-29657 is a use-after-free vulnerability in Linux Kernel's KVM that allows AMD guests to bypass host OS MSR access controls. This post covers the technical details, affected versions, impact, and mitigation.

Published: February 25, 2026

CVE-2021-29657 Overview

CVE-2021-29657 is a use-after-free vulnerability in the Linux kernel's KVM (Kernel-based Virtual Machine) subsystem, specifically affecting the nested SVM (Secure Virtual Machine) implementation for AMD processors. The vulnerability exists in arch/x86/kvm/svm/nested.c in Linux kernel versions before 5.11.12 and allows an AMD KVM guest to bypass access control on host OS MSRs (Model-Specific Registers) when nested guests are present. This flaw stems from a Time-of-Check Time-of-Use (TOCTOU) race condition caused by a VMCB12 double fetch in the nested_svm_vmrun function.

Critical Impact

A malicious nested guest VM can exploit this race condition to gain unauthorized access to host system MSRs, potentially leading to full host compromise, information disclosure, or denial of service in virtualized environments running AMD KVM with nested virtualization enabled.

Affected Products

  • Linux Kernel versions prior to 5.11.12
  • Systems running AMD KVM with nested virtualization enabled
  • Virtualization platforms utilizing vulnerable kernel versions

Discovery Timeline

  • 2021-07-22 - CVE-2021-29657 published to NVD
  • 2024-11-21 - Last updated in NVD database

Technical Details for CVE-2021-29657

Vulnerability Analysis

This vulnerability represents a classic TOCTOU race condition in the nested virtualization code path. When the Linux kernel handles nested virtual machine execution on AMD processors using SVM, it must process the Virtual Machine Control Block (VMCB) structure that controls guest VM behavior. The nested_svm_vmrun function performs a double fetch of the VMCB12 structure (the L1 guest's VMCB for the L2 nested guest), creating a window where the memory contents can be modified between the validation check and the actual use.

The use-after-free condition occurs when the attacker manipulates the VMCB12 structure during this race window. By precisely timing modifications to the guest-controlled VMCB memory, an attacker can cause the kernel to use stale or malicious values that were validated in a previous fetch but have since been altered. This allows bypassing access control mechanisms that protect host MSRs from guest access.

MSRs are privileged CPU registers that control low-level processor behavior including power management, performance monitoring, and security features. Unauthorized access to these registers from a guest VM represents a significant security boundary violation in virtualized environments.

Root Cause

The root cause is a TOCTOU race condition in arch/x86/kvm/svm/nested.c where the nested_svm_vmrun function fetches the VMCB12 structure from guest memory multiple times without proper synchronization. The first fetch validates the structure, while subsequent fetches use the data, allowing the guest to modify the structure between validation and use.

Attack Vector

The attack requires local access to a nested guest VM on an affected system. An attacker operating within an L2 nested guest can exploit the race condition by:

  1. Triggering the nested_svm_vmrun code path through nested virtualization operations
  2. Precisely timing modifications to the VMCB12 structure in shared memory
  3. Racing against the kernel's double fetch to substitute malicious values after validation
  4. Gaining unauthorized access to host MSRs that should be protected from guest access

This is a local attack vector requiring no user interaction, but exploitation complexity is high due to the precise timing requirements inherent in race condition exploitation.

The vulnerability manifests in the nested_svm_vmrun function where VMCB12 data is fetched multiple times from guest-accessible memory. The fix involves caching the VMCB12 data after the initial fetch to prevent the guest from modifying it between validation and use. Technical details are available in the Linux Kernel Commit Details and the Chromium Project Zero Issue.

Detection Methods for CVE-2021-29657

Indicators of Compromise

  • Unusual activity or crashes related to KVM nested virtualization operations
  • Unexpected MSR access attempts logged by the hypervisor
  • Anomalous behavior from nested guest VMs attempting repeated VMRUN operations
  • Kernel oops or panics in the svm/nested.c code path

Detection Strategies

  • Monitor for kernel log entries indicating issues in the nested SVM code path
  • Implement runtime integrity checking for KVM module behavior
  • Deploy kernel-level intrusion detection to identify exploitation attempts targeting race conditions
  • Use audit logging to track nested virtualization operations

Monitoring Recommendations

  • Enable verbose KVM logging for nested virtualization events
  • Monitor system stability for signs of race condition exploitation attempts
  • Track kernel version deployment across virtualized infrastructure
  • Implement alerting for anomalous nested VM behavior patterns

How to Mitigate CVE-2021-29657

Immediate Actions Required

  • Upgrade Linux kernel to version 5.11.12 or later immediately on all affected systems
  • If patching is not immediately possible, consider disabling nested virtualization on AMD KVM hosts
  • Review virtualized infrastructure for systems running vulnerable kernel versions
  • Assess exposure of systems allowing untrusted nested guest VMs

Patch Information

The vulnerability was fixed in Linux kernel version 5.11.12 through commit a58d9166a756a0f4a6618e4f593232593d6df134. The patch addresses the TOCTOU race condition by ensuring the VMCB12 structure is fetched only once and cached for subsequent operations, eliminating the double fetch vulnerability.

Detailed patch information is available in the Linux Kernel ChangeLog and the Linux Kernel Commit Details.

Workarounds

  • Disable nested virtualization on AMD KVM hosts if not required for operations
  • Restrict access to create nested VMs to trusted users only
  • Implement network segmentation to limit exposure of vulnerable hypervisors
  • Consider migrating critical workloads to patched hosts before upgrading remaining infrastructure
bash
# Disable nested virtualization for AMD KVM
echo 0 > /sys/module/kvm_amd/parameters/nested

# Or set in module configuration
echo "options kvm_amd nested=0" > /etc/modprobe.d/kvm-amd.conf

# Verify nested virtualization status
cat /sys/module/kvm_amd/parameters/nested

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.4

  • EPSS Probability0.04%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
  • Impact Assessment
  • ConfidentialityHigh
  • IntegrityNone
  • AvailabilityHigh
  • CWE References
  • CWE-367
  • Technical References
  • Packet Storm Security Report

  • NetApp Security Advisory
  • Vendor Resources
  • Chromium Project Zero Issue

  • Linux Kernel ChangeLog

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