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-38160

CVE-2021-38160: Linux Kernel Buffer Overflow Vulnerability

CVE-2021-38160 is a buffer overflow flaw in Linux Kernel's virtio_console driver that can cause data corruption when triggered by untrusted devices. This article covers technical details, affected versions, and mitigation.

Published: February 25, 2026

CVE-2021-38160 Overview

CVE-2021-38160 is a buffer overflow vulnerability in the Linux kernel's virtio_console driver (drivers/char/virtio_console.c). The vulnerability exists in kernel versions before 5.13.4 and allows data corruption or loss when an untrusted device supplies a buf->len value that exceeds the allocated buffer size. This occurs due to insufficient validation of length values received from the virtual device, potentially enabling local attackers with low privileges to achieve code execution or cause system instability.

Critical Impact

A malicious or compromised virtual device can supply crafted buffer length values to trigger memory corruption, potentially leading to privilege escalation, data corruption, or denial of service in virtualized environments.

Affected Products

  • Linux Kernel (versions prior to 5.13.4)
  • NetApp HCI Bootstrap OS
  • NetApp HCI Compute Node
  • NetApp HCI Management Node
  • NetApp SolidFire
  • NetApp HCI Storage Node
  • NetApp Element Software
  • Debian Linux 9.0 and 10.0
  • Red Hat Enterprise Linux 8.0

Discovery Timeline

  • 2021-08-07 - CVE-2021-38160 published to NVD
  • 2025-05-05 - Last updated in NVD database

Technical Details for CVE-2021-38160

Vulnerability Analysis

The vulnerability resides in the virtio_console driver, which handles virtual console devices in Linux virtualization environments. When retrieving buffers from the virtqueue via virtqueue_get_buf(), the driver directly assigns the length value provided by the device to the buffer's len field without validating that it does not exceed the buffer's actual allocated size. This missing bounds check creates a classic buffer overflow condition (CWE-120) where subsequent operations may read or write beyond the allocated buffer boundaries.

In virtualized environments where the host system or hypervisor may be untrusted or compromised, this vulnerability presents a significant risk. An attacker controlling the virtual device could manipulate the reported buffer length to cause out-of-bounds memory access, potentially corrupting kernel data structures or achieving arbitrary code execution within the guest kernel.

Root Cause

The root cause is the absence of length validation in the virtio_console driver when processing buffer lengths from the virtqueue. The driver trusts the len value returned by virtqueue_get_buf() without verifying it against the actual buffer size (buf->size). This violates the principle of never trusting data from external or potentially untrusted sources, especially in virtualization contexts where the guest kernel should not implicitly trust the host.

Attack Vector

The attack requires local access to a virtualized system where the attacker can control or influence the virtual device behavior. The attack vector is local with low attack complexity and requires low privileges. An attacker would need to:

  1. Gain control over the virtual device or host hypervisor
  2. Supply a malicious buffer length value through the virtqueue that exceeds the allocated buffer size
  3. Trigger buffer operations that use the corrupted length value
  4. Exploit the resulting memory corruption for privilege escalation or system compromise
c
 
 	buf = virtqueue_get_buf(port->in_vq, &len);
 	if (buf) {
-		buf->len = len;
+		buf->len = min_t(size_t, len, buf->size);
 		buf->offset = 0;
 		port->stats.bytes_received += len;
 	}

Source: GitHub Linux Commit

The fix adds a bounds check using min_t() to ensure the assigned length never exceeds the buffer's actual size, preventing buffer overflow regardless of the value supplied by the device.

Detection Methods for CVE-2021-38160

Indicators of Compromise

  • Unexpected kernel panics or system crashes in virtualized environments running affected kernel versions
  • Anomalous memory access patterns or corruption in kernel memory regions associated with virtio_console operations
  • Unusual behavior in virtual console devices or unexpected buffer handling errors in system logs
  • Evidence of privilege escalation attempts originating from virtualized workloads

Detection Strategies

  • Monitor kernel version across all virtualized systems to identify instances running kernels prior to 5.13.4
  • Implement kernel-level monitoring for buffer overflow conditions in virtio subsystem drivers
  • Deploy endpoint detection solutions capable of identifying anomalous kernel memory access patterns
  • Review system logs for virtio_console-related errors or unexpected device behavior

Monitoring Recommendations

  • Enable kernel auditing for virtio device operations in virtualized environments
  • Configure alerting for kernel crashes or panics that may indicate exploitation attempts
  • Monitor for unexpected changes in kernel memory regions used by virtio_console
  • Implement continuous vulnerability scanning to track kernel versions across infrastructure

How to Mitigate CVE-2021-38160

Immediate Actions Required

  • Update the Linux kernel to version 5.13.4 or later on all affected systems
  • Apply vendor-specific patches from distribution maintainers (Debian, Red Hat, NetApp)
  • Prioritize patching for systems in virtualized environments where host trust is a concern
  • Review and restrict access to virtual device configurations in hypervisor settings

Patch Information

The vulnerability is addressed in Linux kernel version 5.13.4. The fix introduces bounds checking using min_t(size_t, len, buf->size) to ensure buffer lengths cannot exceed the allocated buffer size. The patch is available via the Linux Kernel ChangeLog 5.13.4 and the GitHub Linux Commit.

Distribution-specific patches are available from:

  • Debian Security Advisory DSA-4978
  • Red Hat CVE Analysis
  • NetApp Security Advisory NTAP-20210902-0010

Workarounds

  • Limit the use of virtio_console in high-security virtualized environments until patches can be applied
  • Ensure strict access controls on hypervisor and virtual device configurations to prevent untrusted device manipulation
  • Consider disabling virtio_console functionality if not required for operations
  • Implement additional monitoring and runtime protection for kernel operations in virtualized systems
bash
# Check current kernel version for vulnerability status
uname -r

# Verify if virtio_console module is loaded
lsmod | grep virtio_console

# Update kernel on Debian-based systems
apt-get update && apt-get upgrade linux-image-$(uname -r)

# Update kernel on Red Hat-based systems
yum update kernel

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

  • Vulnerability Details
  • TypeBuffer Overflow

  • Vendor/TechLinux Kernel

  • SeverityHIGH

  • CVSS Score7.8

  • EPSS Probability0.04%

  • 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-120
  • Technical References
  • Red Hat CVE Analysis

  • Debian LTS Announcement October 2021

  • Debian LTS Announcement December 2021

  • NetApp Security Advisory NTAP-20210902-0010

  • Debian Security Advisory DSA-4978
  • Vendor Resources
  • Linux Kernel ChangeLog 5.13.4

  • GitHub Linux Commit
  • Related CVEs
  • CVE-2026-23448: Linux Kernel Buffer Overflow Vulnerability

  • CVE-2026-23447: Linux Kernel Buffer Overflow Vulnerability

  • CVE-2026-31395: Linux Kernel Buffer Overflow Vulnerability

  • CVE-2026-31402: Linux Kernel Buffer Overflow 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