CVE-2022-39189 Overview
An issue was discovered in the x86 KVM subsystem in the Linux kernel before version 5.18.17. Unprivileged guest users can compromise the guest kernel because TLB (Translation Lookaside Buffer) flush operations are mishandled in certain KVM_VCPU_PREEMPTED situations. This vulnerability allows malicious guest users to potentially gain elevated privileges within the virtualized environment by exploiting race conditions in the hypervisor's handling of vCPU preemption states.
Critical Impact
Unprivileged guest users can compromise the guest kernel through mishandled TLB flush operations during vCPU preemption, potentially achieving privilege escalation within virtualized environments.
Affected Products
- Linux Linux Kernel (versions before 5.18.17)
- NetApp HCI Baseboard Management Controller H300S
- NetApp HCI Baseboard Management Controller H410C
- NetApp HCI Baseboard Management Controller H410S
- NetApp HCI Baseboard Management Controller H500S
- NetApp HCI Baseboard Management Controller H700S
Discovery Timeline
- 2022-09-02 - CVE CVE-2022-39189 published to NVD
- 2025-05-05 - Last updated in NVD database
Technical Details for CVE-2022-39189
Vulnerability Analysis
This vulnerability exists in the x86 KVM (Kernel-based Virtual Machine) subsystem within the Linux kernel. The issue stems from improper handling of TLB flush operations when a vCPU is reported as preempted outside of instruction boundaries. The TLB is a hardware cache that stores recent translations between virtual and physical memory addresses to speed up memory access. When KVM incorrectly reports a vCPU as preempted at an improper moment, it can lead to stale TLB entries being used, enabling an unprivileged guest user to exploit this condition to compromise the guest kernel.
The vulnerability was discovered and tracked by Google Project Zero as Issue #2309. The local attack vector requires the attacker to have access to the guest system, but exploitation does not require user interaction and can result in complete compromise of confidentiality, integrity, and availability within the guest environment.
Root Cause
The root cause of this vulnerability lies in the KVM subsystem's failure to properly track whether a vCPU is at an instruction boundary before reporting it as preempted. When a vCPU is preempted outside of an instruction boundary (for example, during interrupt handling), the TLB flush operations may not be properly synchronized, leading to potential memory access inconsistencies that can be exploited by guest code.
The fix introduces an at_instruction_boundary boolean flag in the kvm_vcpu_arch structure to properly track the vCPU state and prevent the hypervisor from reporting a vCPU as preempted when it's not at a safe instruction boundary.
Attack Vector
The attack vector is local, requiring the attacker to have unprivileged access within a guest virtual machine. The attacker can exploit the timing window created by the mishandled TLB flush operations during vCPU preemption. By carefully timing their operations, an unprivileged guest user can leverage stale TLB entries to access kernel memory or escalate privileges within the guest OS.
The following patch was applied to address this vulnerability by adding instruction boundary tracking:
// Patch to arch/x86/include/asm/kvm_host.h
u64 ia32_misc_enable_msr;
u64 smbase;
u64 smi_count;
+ bool at_instruction_boundary;
bool tpr_access_reporting;
bool xsaves_enabled;
bool xfd_no_write_intercept;
Source: GitHub Linux Commit 6cd88243
The SVM (AMD Secure Virtual Machine) handler was also updated to properly set this flag:
// Patch to arch/x86/kvm/svm/svm.c
static void svm_handle_exit_irqoff(struct kvm_vcpu *vcpu)
{
+ if (to_svm(vcpu)->vmcb->control.exit_code == SVM_EXIT_INTR)
+ vcpu->arch.at_instruction_boundary = true;
}
static void svm_sched_in(struct kvm_vcpu *vcpu, int cpu)
Source: GitHub Linux Commit 6cd88243
Detection Methods for CVE-2022-39189
Indicators of Compromise
- Unusual memory access patterns from guest virtual machines attempting to access kernel memory regions
- Unexpected privilege escalation events within guest operating systems
- Anomalous KVM-related kernel log entries indicating TLB synchronization issues
- Guest kernel crashes or instabilities that may indicate exploitation attempts
Detection Strategies
- Monitor kernel logs for KVM subsystem warnings or errors related to TLB operations and vCPU state transitions
- Implement runtime integrity checking within guest kernels to detect unauthorized privilege changes
- Deploy SentinelOne Singularity Platform for real-time detection of privilege escalation attempts in virtualized environments
- Audit kernel versions across all hypervisor hosts to identify systems running vulnerable Linux kernel versions
Monitoring Recommendations
- Enable detailed KVM debug logging on production hypervisors to capture potential exploitation attempts
- Implement host-based intrusion detection to monitor for suspicious guest-to-host interactions
- Configure alerting for kernel version mismatches against security baselines in your virtualization infrastructure
How to Mitigate CVE-2022-39189
Immediate Actions Required
- Upgrade Linux kernel to version 5.18.17 or later on all affected hypervisor systems
- Apply vendor-provided security patches for NetApp HCI Baseboard Management Controller systems
- Review and update any custom KVM configurations to ensure proper security hardening
- Audit guest virtual machines for signs of potential compromise
Patch Information
The vulnerability has been addressed in Linux kernel version 5.18.17. The fix is tracked via commit 6cd88243c7e03845a450795e134b488fc2afb736 and is documented in the Linux Kernel ChangeLog 5.18.17. Distribution-specific patches are available through Debian Security Advisory DSA-5480 and Debian LTS Announcement. NetApp users should consult the NetApp Security Advisory NTAP-20230214-0007 for guidance on affected HCI BMC systems.
Workarounds
- Limit guest user privileges and implement strict access controls within virtual machines
- Consider disabling vCPU preemption features if operationally feasible in your environment (may impact performance)
- Implement network segmentation to isolate virtualized workloads from critical infrastructure
- Deploy additional monitoring and logging for KVM hypervisor systems until patches can be applied
# Check current kernel version
uname -r
# Verify if running a vulnerable kernel version (before 5.18.17)
# Update kernel on Debian/Ubuntu systems
sudo apt update && sudo apt upgrade linux-image-$(uname -r)
# Update kernel on RHEL/CentOS systems
sudo yum update kernel
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.


