CROSSLINE: Breaking "Security-by-Crash" based Memory Isolation in AMD SEV

Mengyuan Li, Yinqian Zhang, Zhiqiang Lin

Introduction

AMD's Secure Encrypted Virtualization (SEV) is a hardware-based security feature designed to isolate Virtual Machines (VMs) from a potentially malicious hypervisor. The security model relies heavily on Address Space Identifiers (ASIDs). These identifiers tag cache lines and Translation Lookaside Buffer (TLB) entries, directing the AMD Secure Processor (AMD-SP) to use the correct encryption key for a specific VM's memory.

AMD SEV Architecture and ASID Management

Historically, AMD engineers operated under a "security-by-crash" design principle. They argued that while a hypervisor controls ASID assignments, any attempt to assign an incorrect ASID would result in the VM fetching improperly decrypted "junk" data, leading to an immediate system crash. This paper introduces CrossLine, an attack that shatters this assumption by demonstrating that meaningful data can be leaked in the milliseconds before a crash occurs.

Attack Methodology

The CrossLine attack involves a malicious hypervisor launching an "attacker VM" while surreptitiously assigning it the ASID of a victim VM. This allows the attacker to leverage the victim's encryption keys. The authors present two primary variants:

CrossLine V1: Page Table Walk Exploitation

This variant targets the hardware's nested page table (nPT) walker. By remapping the attacker's page tables to point to the victim's encrypted memory, the hardware is tricked into reading victim data as a Page Table Entry (PTE). If the data conforms to a valid PTE format, the hardware leaks the decrypted address through a nested page fault (NPF) reported to the hypervisor.

CrossLine V1 Attack Flow

CrossLine V2: Instruction Oracles

A more aggressive approach, CrossLine V2 identifies specific instruction "gadgets" within the victim's encrypted memory. By manipulating the attacker VM's state to execute these instructions using the victim's ASID, the attacker creates decryption or encryption oracles capable of leaking or modifying arbitrary memory.

Evaluation and Results

The researchers evaluated CrossLine on real AMD EPYC hardware. To assess the viability of CrossLine V1, they analyzed the binary files of ten common applications (e.g., OpenSSH, Python, Nginx) on Ubuntu 18.04. They found that 1% to 6.5% of 8-byte memory blocks in these binaries naturally conform to the "Valid PTE" format, enabling direct data leakage.

Key performance metrics include:

  • Decryption Speed (V1): A 4KB page can be decrypted in approximately 39.58ms on standard SEV. On SEV-ES, which includes additional integrity checks, the speed is roughly 2ms per 8-byte block.
  • Oracle Efficiency (V2): A decryption oracle constructed via CrossLine V2 can decrypt a 4KB page in 113.6ms.

Key Insights

The core contribution of this work is the debunking of the "security-by-crash" fallacy. Hardware components, such as the Memory Management Unit (MMU), perform significant work and generate side-channel information (like fault addresses) before a terminal fault is triggered at the CPU core level. Furthermore, the attack is stealthy; because it utilizes a separate attacker VM, it remains invisible to the victim and can even be executed after a victim VM has been shut down, provided its keys persist in the AMD-SP.

Limitations and Mitigation

While CrossLine is effective against SEV and SEV-ES, the latest iteration, SEV-SNP (Secure Nested Paging), introduces a Reverse Map Table (RMP). The RMP tracks page ownership, preventing the hypervisor from remapping victim pages into an attacker's address space—a critical step for CrossLine. The authors conclude that future hardware security should move toward such principled, hardware-enforced isolation rather than relying on ad-hoc crash-based defenses.

Summary updated

BibTeX
@inproceedings{li2021crossline,
  author = {Mengyuan Li and Yinqian Zhang and Zhiqiang Lin},
  title = {{CROSSLINE: Breaking "Security-by-Crash" based Memory Isolation in AMD SEV}},
  booktitle = {CCS},
  year = {2021},
  doi = {10.1145/3460120.3485253},
}
Figure