Confidential computing allows customers to off-load their computation to the cloud without having to trust the cloud provider. One of the approaches to enable confidential computing is by anchoring the trust in the hardware. AMD’s SEV-SNP, one such hardware mechanism, supports confidential computing by creating confidential virtual machines. With RMPocalypse, we demonstrate an attack on all AMD processors that support SEV-SNP (Zen 3/4/5) and compromise all confidential computing guarantees. Reverse Map Table, in short RMP, is one of the main protection mechanisms in SEV-SNP to stop the hypervisor from accessing the confidential virtual machines. In RMPocalypse, we exploit AMD’s incomplete protections that allow us to perform a single memory write to the RMP, thus breaking SEV-SNP.
What is AMD SEV-SNP?
Secure Encrypted Virtualization-Secure Nested Paging, SEV-SNP for short, is AMD’s latest hardware extension to support confidential computing.
What is RMP?
SEV-SNP uses a data structure called Reverse Map Table (RMP) to store security metadata for all DRAM pages in the system. Since RMP can be large in size, it is stored in the DRAM. Now you might ask, who protects the RMP? Well, the RMP! Easier said than done, as this design choice by AMD creates a chicken-and-egg problem. The main challenge lies in the initialization, when the RMP is being set up in the DRAM, there has to be an orthogonal mechanism in place to make sure this is done correctly. Only after a successful initialization can the RMP protect itself (and of course the confidential VMs). AMD has an elegant solution to this problem. They use a security co-processor called the PSP to initialize the RMP. During initialization, platform protection mechanisms configured by the PSP protect the RMP.
What went wrong?
RMPocalypse shows that AMD’s platform protection mechanisms are not complete, thus leaving a small window of opportunity for the attacker to maliciously overwrite the RMP on initialization. Due to the design of the RMP, a single overwrite of 8 bytes within the RMP causes the entire RMP to become subsequently compromised. With a compromised RMP, all integrity guarantees of SEV-SNP become void. RMPocalypse case studies show that an attacker-controlled RMP not only voids the integrity but also results in a full breach of confidentiality.
What can an attacker do with this vulnerability?
We showcase RMPocalypse primitives by forging attestation values, enabling debug, reading and writing arbitrary encrypted CVM memory, and replaying the CVM register state.