cve.bz

CVE-2021-29657 linux linux kernel: Use After Free

7.4 highExploit referenceEPSS 0.4%Fix available

High (7.4) in linux linux kernel. EPSS 0.4% estimated probability of exploitation activity in the next 30 days.

On this page
arch/x86/kvm/svm/nested.c in the Linux kernel before 5.11.12 has a use-after-free in which an AMD KVM guest can bypass access control on host OS MSRs when there are nested guests, aka CID-a58d9166a756. This occurs because of a TOCTOU race condition associated with a VMCB12 double fetch in nested_svm_vmrun.

Severity

CVSS 3.1

7.4 high
CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
EPSS
0.4% (unchanged from 0.4% a week ago; 0.4% 30 days ago) estimated probability of exploitation activity in the next 30 days; 37th percentile. Scored 2026-11-22. A forecast for this CVE across the internet, not for your own systems.
CWEs
CWE-367 Time-of-check Time-of-use (TOCTOU) Race Condition
CWE-416 Use After Free
Published
Modified
NVD analysis
Analyzed, since modified
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2021-29657 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2021-29657?via=ask-ai-copy and https://cve.bz/cve/CVE-2021-29657?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2021-29657 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the NVD's CPE matches.

ProductAffected
linux:linux_kernelfrom 5.10 before 5.10.28
linux:linux_kernelfrom 5.11 before 5.11.12

Linux distributions

DistributionReleasePackageFixed inAdvisory
Debian12, 13, 14linux5.10.28-1DEBIAN-CVE-2021-29657
Ubuntu16.04:LTSlinux-hwe-edgeno fix listedUBUNTU-CVE-2021-29657
Ubuntu18.04:LTSlinux-gcp, linux-hwe, linux-oem and 11 moreno fix listedUBUNTU-CVE-2021-29657
Ubuntu20.04:LTSlinux-oem-5.105.10.0-1025.26UBUNTU-CVE-2021-29657 USN-4948-1
Ubuntu20.04:LTSlinux-riscv, linux-raspi2no fix listedUBUNTU-CVE-2021-29657
Red Hatenterprise_linux:8::baseosperf, kernel, bpftool and 30 more0:4.18.0-348.el8RHSA-2021:4356
Red Hatenterprise_linux:8::crbperf-debuginfo, kernel-debuginfo, bpftool-debuginfo and 7 more0:4.18.0-348.el8RHSA-2021:4356
Azure Linux2kernel5.10.78.1-1AZL-6554

From the distributions' data via OSV.dev: the Debian Security Tracker; Ubuntu Security Notices © Canonical Ltd., CC BY-SA 4.0; Red Hat Security Data © Red Hat, Inc., CC BY 4.0; Microsoft's Azure Linux vulnerability data, MIT. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Debian · Ubuntu · Red Hat.

Red Hat

Red Hat rates this Moderate.

Red Hat's statement

The nested virtualization feature is not enabled by default up to Red Hat Enterprise Linux 8.4. Most importantly, Red Hat currently provides nested virtualization only as a Technology Preview, and is therefore unsupported for production use. For additional details please see https://access.redhat.com/solutions/21101 and https://access.redhat.com/support/offerings/techpreview.

Red Hat's mitigation

This vulnerability can be mitigated by disabling the nested virtualization feature:

```

# modprobe -r kvm_amd

# modprobe kvm_amd nested=0

```

ProductPackageStateAdvisory
Red Hat Enterprise Linux 8kernel-0:4.18.0-348.el8Fixed 2021-11-09RHSA-2021:4356
Red Hat Enterprise Linux 6kernelNot affected
Red Hat Enterprise Linux 7kernelNot affected
Red Hat Enterprise Linux 7kernel-altNot affected
Red Hat Enterprise Linux 7kernel-rtNot affected
Red Hat Enterprise Linux 8kernel-rtAffected
Red Hat Enterprise Linux 9kernelNot affected

Contains Red Hat Security Data © Red Hat, Inc., licensed under CC BY 4.0. Source: https://access.redhat.com/security/data. Modified: reformatted. Red Hat's page for CVE-2021-29657.

Attack patterns (CAPEC)

  • CAPEC-27 Leveraging Race Conditions via Symbolic Links Likelihood: Medium · Severity: High
  • CAPEC-29 Leveraging Time-of-Check and Time-of-Use (TOCTOU) Race Conditions Likelihood: High · Severity: High

The attack patterns MITRE's CAPEC relates to this record's weaknesses, as MITRE names them. Credits.

References

Check your stackJSON