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

Mengyuan Li, Yinqian Zhang, Zhiqiang Lin

TL;DR

The CrossLine attack shatters the "security-by-crash" design principle of AMD’s Secure Encrypted Virtualization (SEV). By momentarily impersonating a victim VM's hardware identifier (ASID), an untrusted hypervisor can trick the processor into decrypting victim memory or executing its instructions as "oracles" to leak sensitive data—all before the system has a chance to crash.

What Problem Does This Paper Address?

AMD SEV is a hardware feature designed to protect Virtual Machines (VMs) from a malicious or compromised hypervisor by encrypting their memory. A core pillar of SEV’s design is the use of Address Space Identifiers (ASIDs). These IDs tag cache lines and TLB entries and tell the secure processor which encryption key to use.

AMD’s engineers operated under a "security-by-crash" assumption: they argued that even though a hypervisor controls ASID assignments, assigning the "wrong" ID to a VM would cause it to immediately fetch "junk" (improperly decrypted) data and crash. Therefore, they believed improper ASID management wasn't a security risk. This paper challenges that assumption, asking: Can an attacker perform meaningful work in the split second before the crash occurs?

Methods

The authors introduce CrossLine, a class of attacks where a malicious hypervisor launches an "attacker VM" but assigns it the victim VM's ASID. They present two main variants:

  • CrossLine V1 (Page Table Walk Exploitation): This variant exploits the hardware's nested page table (nPT) walker. The hypervisor sets up the attacker VM such that a memory access triggers a page table walk. By remapping the attacker's "page tables" to point to the victim's encrypted data, the hardware attempts to "read" that data as a Page Table Entry (PTE). If the data happens to look like a valid PTE, the hardware leaks the decrypted address through a nested page fault (NPF) reported back to the hypervisor.
  • CrossLine V2 (Instruction Oracles): This variant is more aggressive. The attacker identifies specific instructions (gadgets) within the victim's encrypted memory—such as a mov instruction that loads data into a register. By manipulating the attacker VM's execution state to run these instructions using the victim's ASID/key, the attacker creates decryption or encryption "oracles" that can leak or modify arbitrary memory.

Datasets

As this is a hardware security paper, it does not use traditional training datasets. Instead, the authors evaluated the "readability" of memory by analyzing the binary files of ten common applications (including OpenSSH, Python, and Nginx) installed on Ubuntu 18.04. They measured what percentage of 8-byte memory blocks in these binaries conform to the "Valid PTE" format required for CrossLine V1 to succeed.

Key Insights and Ideas

  • The "Security-by-Crash" Fallacy: The most significant insight is that a crash is not an instantaneous security boundary. Hardware components (like the page table walker) perform work and generate side-channel information (like fault addresses) before the CPU core actually triggers a terminal fault.
  • Hardware as a Decryption Tool: CrossLine V1 effectively turns the CPU's own memory management unit (MMU) into a decryption engine. The attacker doesn't need to execute a single instruction; they just need to trigger a hardware-level page walk.
  • Stealth and Persistence: Because the attack uses a separate attacker VM, it is completely invisible to the victim. Furthermore, the attack can be performed even if the victim VM is shut down, as long as its encryption key remains in the AMD Secure Processor (AMD-SP) and its pages are still in DRAM.
  • Bypassing SEV-ES: Even though SEV-ES (Encrypted State) protects a VM's registers, the authors found they could bypass this by "parking" a victim's Virtual Machine Save Area (VMSA) and forcing the attacker VM to reuse it, allowing the attack to persist on newer hardware.

Key Results

  • Success on Real Hardware: The attacks were successfully demonstrated on AMD EPYC processors.
  • Decryption Speed: On standard SEV, CrossLine V1 can decrypt a 4KB memory page in approximately 39.58ms. On SEV-ES, the process is slower (roughly 2ms per 8-byte block) due to additional hardware integrity checks, but still entirely feasible.
  • Data Leakage Potential: Analysis of common binaries showed that 1% to 6.5% of memory blocks naturally conform to the PTE format, allowing for direct leakage. While this is a small percentage, it is often enough for "process fingerprinting" or stealing specific cryptographic keys.
  • Oracle Power: CrossLine V2 was used to construct a decryption oracle that could decrypt a 4KB page in 113.6ms, proving that the "security-by-crash" principle fails even against complex instruction execution.

Limitations and Future Work

The primary limitation is that SEV-SNP (Secure Nested Paging), the latest iteration of the technology, likely mitigates these specific attacks. SEV-SNP introduces a Reverse Map Table (RMP) that tracks the ownership of every memory page. This prevents the hypervisor from remapping a victim's page into an attacker's address space, which is a prerequisite for CrossLine.

The authors suggest that future research should move away from ad-hoc "security-by-crash" defenses and toward principled, hardware-enforced isolation where the identity of a VM is tied to its memory at a fundamental architectural level—something AMD has begun to address with the RMP in SEV-SNP.

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