# CVE-2021-46978: KVM: nVMX: Always make an attempt to map eVMCS after migration

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** HIGH 7.8
- **CVSS:** 7.8 (v3.1, CNA) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: High; Integrity impact: High; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.24% (percentile 9, 2026-11-28)
- **Published:** 2024-02-28T08:13:09.106Z
- **Modified:** 2026-06-17T04:16:03.320Z

## Who should check

- Anyone running Linux \>= 0faceb7d6dda6f370ff1fa0464d7180f7e5cb417, \< c8bf64e3fb77cc19bad146fbe26651985b117194; \>= f2c7ef3ba9556d62a7e2bb23b563c6510007d55c, \< 200a45649ab7361bc80c70aebf7165b64f9a6c9f; \>= f2c7ef3ba9556d62a7e2bb23b563c6510007d55c, \< bd0e8455b85b651a4c77de9616e307129b15aaa7; \>= f2c7ef3ba9556d62a7e2bb23b563c6510007d55c, \< f5c7e8425f18fdb9bdb7d13340651d7876890329; \>= 5.10.13, \< 5.10.38
- Anyone running Linux 5.11

## 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 and fixed versions

- Linux: \>= 0faceb7d6dda6f370ff1fa0464d7180f7e5cb417, \< c8bf64e3fb77cc19bad146fbe26651985b117194; \>= f2c7ef3ba9556d62a7e2bb23b563c6510007d55c, \< 200a45649ab7361bc80c70aebf7165b64f9a6c9f; \>= f2c7ef3ba9556d62a7e2bb23b563c6510007d55c, \< bd0e8455b85b651a4c77de9616e307129b15aaa7; \>= f2c7ef3ba9556d62a7e2bb23b563c6510007d55c, \< f5c7e8425f18fdb9bdb7d13340651d7876890329; \>= 5.10.13, \< 5.10.38 (cvelist)
- Linux: 5.11 (cvelist)

## Mitigation

- Upgrade Linux to 5.10.38 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2021-46978. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2021-46978.md
Affected: Linux >= 0faceb7d6dda6f370ff1fa0464d7180f7e5cb417, < c8bf64e3fb77cc19bad146fbe26651985b117194; >= f2c7ef3ba9556d62a7e2bb23b563c6510007d55c, < 200a45649ab7361bc80c70aebf7165b64f9a6c9f; >= f2c7ef3ba9556d62a7e2bb23b563c6510007d55c, < bd0e8455b85b651a4c77de9616e307129b15aaa7; >= f2c7ef3ba9556d62a7e2bb2…
Fixed in: Linux 200a45649ab7361bc80c70aebf7165b64f9a6c9f, Linux 5.10.38

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2021-46978 being exploited?

There is no confirmed exploitation: CVE-2021-46978 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.24% chance of exploitation in the next 30 days (as of 2026-11-28).

### How serious is CVE-2021-46978?

High: CVSS 7.8 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2021-46978?

Linux \>= 0faceb7d6dda6f370ff1fa0464d7180f7e5cb417, \< c8bf64e3fb77cc19bad146fbe26651985b117194; \>= f2c7ef3ba9556d62a7e2bb23b563c6510007d55c, \< 200a45649ab7361bc80c70aebf7165b64f9a6c9f; \>= f2c7ef3ba9556d62a7e2bb23b563c6510007d55c, \< bd0e8455b85b651a4c77de9616e307129b15aaa7; \>= f2c7ef3ba9556d62a7e2bb23b563c6510007d55c, \< f5c7e8425f18fdb9bdb7d13340651d7876890329; \>= 5.10.13, \< 5.10.38; Linux 5.11.

### Is there a fix for CVE-2021-46978?

Yes. Fixed in Linux 200a45649ab7361bc80c70aebf7165b64f9a6c9f, Linux 5.10.38. Upgrade Linux to 5.10.38 or later.

### How do I check if I'm affected by CVE-2021-46978?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <https://git.kernel.org/stable/c/c8bf64e3fb77cc19bad146fbe26651985b117194>
- patch: <https://git.kernel.org/stable/c/200a45649ab7361bc80c70aebf7165b64f9a6c9f>
- patch: <https://git.kernel.org/stable/c/bd0e8455b85b651a4c77de9616e307129b15aaa7>
- patch: <https://git.kernel.org/stable/c/f5c7e8425f18fdb9bdb7d13340651d7876890329>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2021-46978>

HTML: <https://flawdb.com/CVE-2021-46978> · JSON: <https://flawdb.com/api/v1/entries/CVE-2021-46978>
