CVE-2021-46978

KVM: nVMX: Always make an attempt to map eVMCS after migration

HIGH
7.8
CVSS Score
Published: February 28, 2024 at 08:13 AM UTC
Updated: June 17, 2026 at 04:16 AM UTC
1 product affected across 1 vendorLinux Kernel

Using Linux by Linux?

Get instant alerts when new vulnerabilities affect Linux - before attackers find them.

Real-time alertsTrack your software stackFree plan available
Severity
HIGH7.8
Exploit prediction
EPSS 0.2%
SSVC
No known exploit

Description

In the Linux kernel, the following vulnerability has been resolved: KVM: nVMX: Always make an attempt to map eVMCS after migration When enlightened VMCS is in use and nested state is migrated with vmx_get_nested_state()/vmx_set_nested_state() KVM can't map evmcs page right away: evmcs gpa is not 'struct kvm_vmx_nested_state_hdr' and we can't read it from VP assist page because userspace may decide to restore HV_X64_MSR_VP_ASSIST_PAGE after restoring nested state (and QEMU, for example, does exactly that). To make sure eVMCS is mapped /vmx_set_nested_state() raises KVM_REQ_GET_NESTED_STATE_PAGES request. Commit f2c7ef3ba955 ("KVM: nSVM: cancel KVM_REQ_GET_NESTED_STATE_PAGES on nested vmexit") added KVM_REQ_GET_NESTED_STATE_PAGES clearing to nested_vmx_vmexit() to make sure MSR permission bitmap is not switched when an immediate exit from L2 to L1 happens right after migration (caused by a pending event, for example). Unfortunately, in the exact same situation we still need to have eVMCS mapped so nested_sync_vmcs12_to_shadow() reflects changes in VMCS12 to eVMCS. As a band-aid, restore nested_get_evmcs_page() when clearing KVM_REQ_GET_NESTED_STATE_PAGES in nested_vmx_vmexit(). The 'fix' is far from being ideal as we can't easily propagate possible failures and even if we could, this is most likely already too late to do so. The whole 'KVM_REQ_GET_NESTED_STATE_PAGES' idea for mapping eVMCS after migration seems to be fragile as we diverge too much from the 'native' path when vmptr loading happens on vmx_set_nested_state().

Affected

Our own answer: ranges merged, affected separated from platform-only, with confidence and review flags.

v ≥ 5.13v < 5.11*5.10.13 ≤ v < 5.10.385.11 ≤ v < 5.11.225.11 ≤ v < 5.12.55.11 ≤ v < 5.135.12 ≤ v < 5.12.50faceb7d6dda0faceb7d6dda6f370ff1fa0464d7180f7e5cb4175.10.135.135.13 rc1f2c7ef3ba955f2c7ef3ba9556d62a7e2bb23b563c6510007d55c
Vendor states this is fixed in 200a45649ab7 (fixed)
Vendor states this is fixed in 200a45649ab7361bc80c70aebf7165b64f9a6c9f (fixed)
Vendor states this is fixed in bd0e8455b85b (fixed)
Vendor states this is fixed in bd0e8455b85b651a4c77de9616e307129b15aaa7 (fixed)
Vendor states this is fixed in c8bf64e3fb77 (fixed)
Vendor states this is fixed in c8bf64e3fb77cc19bad146fbe26651985b117194 (fixed)
Vendor states this is fixed in f5c7e8425f18 (fixed)
Vendor states this is fixed in f5c7e8425f18fdb9bdb7d13340651d7876890329 (fixed)
Vendor states this is fixed in 5.10.38 (unaffected)
Vendor states this is fixed in 5.11 (unaffected)
Vendor states this is fixed in 5.11.22 (unaffected)
Vendor states this is fixed in 5.12.5 (unaffected)
Vendor states this is fixed in 5.13 (unaffected)

References (4)

Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/200a45649ab7361bc80c70aebf7165b64f9a6c9f
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/bd0e8455b85b651a4c77de9616e307129b15aaa7
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/c8bf64e3fb77cc19bad146fbe26651985b117194
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/f5c7e8425f18fdb9bdb7d13340651d7876890329

SSVC — Action Prioritization

SSVCNo known exploitNot automatableTotal impact

SSVC signals action urgency (what to patch first), separate from CVSS which measures severity.

CVSS

7.8HIGHCISA-ADP
Attack Vector
LOCAL
Complexity
LOW
Privileges
LOW
User Interaction
NONE
Scope
UNCHANGED
Confidentiality
HIGH
Integrity
HIGH
Availability
HIGH
Vector?

Quick Info

StatusANALYZED
CWE
NVD-CWE-noinfo

Get alerted

Stop reading CVE feeds looking for your own stack

Track the products you run and VulnTracker tells you when a new CVE affects them — with what is known about fixing it, and nothing about the rest.

Free plan, no card