In the Linux kernel, the following vulnerability has been resolved:
x86/virt/sev: Revert "Drop WBINVD before setting MSR_AMD64_SYSCFG_SNP_EN"
Revert
99cf1fb58e68 ("x86/virt/sev: Drop WBINVD before setting MSR_AMD64_SYSCFG_SNP_EN").
Section 8.8 of the SNP spec says:
Before invoking SNP_INIT_EX with INIT_RMP set to 1, software must ensure
that no CPUs contain dirty cache lines for the memory containing the RMP.
Cachelines can be moved from cache to cache in a dirty state. The
wbinvd_on_all_cpus() before SNP_INIT_EX flushes the caches for each CPU, but
if the IPIs for WBINVD race with this dirty cacheline movement, it is possible
that they may not get flushed, violating the firmware requirement.
Doing wbinvd_on_all_cpus() before setting SNPEn is safer since the RMP
table is not yet in use.
[ Heroically bisected by Srikanth. ]
[ bp: Massage commit message. ]
CVSS Vector: CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H
CVSS Score: 9.3
AV:L - The flaw is in host-side SNP platform initialization via snp_prepare(), reached only during local boot-time KVM/SEV setup or privileged KVM_SEV_INIT/ioctl paths on /dev/kvm and /dev/sev, not from any network-facing handler.
AC:L - The missing pre-SNPEn WBINVD creates a race where later WBINVD IPIs can miss dirty RMP cachelines; an attacker who can drive concurrent CPU/cache activity during init can influence this timing, and when uncertain we choose Low.
PR:N - On typical SEV-SNP cloud hosts SNP init runs automatically at boot, so a malicious confidential VM tenant needs no host privileges to exploit latent incorrect RMP state that breaks guest/host memory isolation.
UI:N - Exploitation does not require any victim user action such as opening files or mounting filesystems; the vulnerable initialization runs during host boot or privileged hypervisor setup without end-user interaction.
S:C - Corrupt or inconsistent RMP initialization undermines the SEV-SNP memory-isolation boundary between confidential guests and the hypervisor, enabling cross-boundary impact beyond the initializing kernel component's security scope.
C:H - Incorrect RMP table state from unflushed dirty cachelines can break private/shared page tracking and allow unauthorized reads of host or other guest memory across the confidentiality boundary on affected AMD SEV-SNP systems.
I:H - RMP metadata corruption can mislabel page ownership and permissions, potentially permitting unauthorized writes or guest-controlled modification of hypervisor memory and enabling further compromise of the isolation model.
A:H - Violating RMP initialization requirements can trigger fatal RMP faults (#PF) that crash the host kernel, and SNP init failures or inconsistent RMP state can deny availability of confidential VM services.
| Attack Vector |
Local |
Scope |
Changed |
| Attack Complexity |
Low |
Confidentiality Impact |
High |
| Privileges Required |
None |
Integrity Impact |
High |
| User Interaction |
None |
Availability Impact |
High |
AV:L - The flaw is in host-side SNP platform initialization via snp_prepare(), reached only during local boot-time KVM/SEV setup or privileged KVM_SEV_INIT/ioctl paths on /dev/kvm and /dev/sev, not from any network-facing handler.
AC:L - The missing pre-SNPEn WBINVD creates a race where later WBINVD IPIs can miss dirty RMP cachelines; an attacker who can drive concurrent CPU/cache activity during init can influence this timing, and when uncertain we choose Low.
PR:N - On typical SEV-SNP cloud hosts SNP init runs automatically at boot, so a malicious confidential VM tenant needs no host privileges to exploit latent incorrect RMP state that breaks guest/host memory isolation.
UI:N - Exploitation does not require any victim user action such as opening files or mounting filesystems; the vulnerable initialization runs during host boot or privileged hypervisor setup without end-user interaction.
S:C - Corrupt or inconsistent RMP initialization undermines the SEV-SNP memory-isolation boundary between confidential guests and the hypervisor, enabling cross-boundary impact beyond the initializing kernel component's security scope.
C:H - Incorrect RMP table state from unflushed dirty cachelines can break private/shared page tracking and allow unauthorized reads of host or other guest memory across the confidentiality boundary on affected AMD SEV-SNP systems.
I:H - RMP metadata corruption can mislabel page ownership and permissions, potentially permitting unauthorized writes or guest-controlled modification of hypervisor memory and enabling further compromise of the isolation model.
A:H - Violating RMP initialization requirements can trigger fatal RMP faults (#PF) that crash the host kernel, and SNP init failures or inconsistent RMP state can deny availability of confidential VM services.
CVSS 3.1