# US 2023/0058863 A1 · Countermeasures against side-channel attacks on secure encrypted virtualization (sev)-secure nested paging (sev-snp) processors

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2023/0058863 A1
- Document ID: US20230058863A1
- Status: Published application
- Kind: A1
- Application number: 17/715,858
- Filed: 2022-04-07
- Published: 2023-02-23
- Earliest claimed: 2021-08-10
- Assignees: Baidu USA LLC
- Applicants: Baidu USA, LLC
- Inventors: Huibo WANG; Kang LI; Mengyuan LI; Yueqiang CHENG
- Web page: https://patentgrep.com/patent/US20230058863A1

## CPC

- H04L 9/004: {for fault attacks}
- G06F 9/45558: {Hypervisor-specific management and integration aspects}
- G06F 21/53: by executing in a restricted environment, e.g. sandbox or secure virtual machine
- G06F 21/556: {involving covert channels, i.e. data leakage between processes (inhibiting the analysis of circuitry or operation with measures against power attack G06F21/755)}
- G06F 21/602: {Providing cryptographic facilities or services}
- G06F 21/62: Protecting access to data via a platform, e.g. using keys or access control rules
- H04L 9/002: {Countermeasures against attacks on cryptographic mechanisms (network architectures or network communication protocols for protection against malicious traffic H04L63/1441)}
- H04L 9/005: {for timing attacks}
- G06F 2009/45591: {Monitoring or debugging support}
- H04L: TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION (arrangements common to telegraphic and telephonic communication H04M)
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

AMD's Secure Encrypted Virtualization (SEV) is a hardware extension available in AMD's EPYC™ server processors to support confidential cloud computing. Although known attacks against SEV, which exploit its lack of encryption in the virtual machine (VM) control block or the lack of integrity protection of the encrypted memory and nested page tables, have been addressed in subsequent releases of SEV-Encrypted State (SEV-ES) and SEV-Secure Nested Paging (SEV-SNP), a new CipherLeaks attack presents a previously unexplored vulnerability for SEV-ES and SEV-SNP. The attack allows a privileged adversary to infer a guest VM's execution states or recover certain plaintext, e.g., to steal private keys from the constant-time implementation of the Rivest-Shamir-Adleman (RSA) algorithm and the Elliptic Curve Digital Signature Algorithm (ECDSA) in the latest OpenSSL library.

## Claims

### Claim 1

A computer-implemented method for reducing leakage of confidential information from guest virtual machine (VM) registers, the method comprising:
in response to a current user attempting to access a memory page associated with a guest physical address of a guest VM, determining whether a Translation Look-aside Buffer (TLB) miss exists in a TLB that comprises a TLB entry, the TLB miss being indicative of an address translation from a guest virtual address to a system physical address not being present in the TLB entry; and
in response to determining that the TLB miss exists, using one or more processors to perform steps comprising:
performing a page table walk that uses page table entries in at least one of a guest page table or a nested page table (NPT) to obtain the address translation;
using a Reverse Map Table (RMP) entry, which identifies an owner of the memory page, to determine whether the current user is the owner of the memory page to validate the memory page;
in response to determining that the current user is the owner of the memory page, validating the memory page and granting read access to the current user to fetch the TLB entry from the TLB; and
otherwise, denying read access to prevent an attack that requires a modification of the NPT and triggering a page fault.

### Claim 2 (depends on 1)

The method according to claim 1, wherein the modification comprises remapping of an entry in the NPT comprising the guest physical address to at least one of a memory page not associated with the current guest VM.

### Claim 3 (depends on 1)

The method according to claim 1, wherein validating the memory page comprises the guest VM, in response to receiving an instruction to validate the guest physical address, interacts with a hypervisor to validate the RMP entry.

### Claim 4 (depends on 3)

The method according to claim 3, wherein the memory page is validated prior to granting access to the guest physical address in the NPT to prevent the current user from modifying the RMP entry, thereby, maintaining a one-to-one mapping between the guest physical address and the system physical address.

### Claim 5 (depends on 3)

The method according to claim 3, further comprising preventing the hypervisor from reading ciphertext in a memory region of the guest VM that comprises register values in a VM Save Area (VMSA) to infer plaintext therefrom.

### Claim 6 (depends on 3)

The method according to claim 3, wherein the RMP entry is indexed by one or more system page frame numbers.

### Claim 7 (depends on 3)

The method according to claim 3, wherein the RMP entry identifies the owner using at least one page state that comprises page ownership information.

### Claim 8 (depends on 1)

The method according to claim 1, further comprising, in response to determining that the TLB miss does not exist, using the TLB entry to translate the guest virtual address to the system physical address without performing the page table walk.

### Claim 9

A system for reducing leakage of confidential information from guest virtual machine (VM) registers, the system comprising:
one or more processors; and
a non-transitory computer-readable medium or media comprising one or more sets of instructions which, when executed by at least one of the one or more processors, causes steps to be performed comprising:
in response to a current user attempting to access a memory page associated with a guest physical address of a guest VM, determining that a Translation Look-aside Buffer (TLB) miss exists in a TLB that comprises a TLB entry, the TLB miss being indicative of an address translation from a guest virtual address to a system physical address not being present in the TLB entry;
performing a page table walk that uses page table entries in at least one of a guest page table or a nested page table (NPT) to obtain the address translation;
using a Reverse Map Table (RMP) entry, which identifies an owner of the memory page, to determine whether the current user is the owner of the memory page to validate the memory page;
in response to determining that the current user is the owner of the memory page, validating the memory page and granting read access to the current user to fetch the TLB entry from the TLB; and
in response to determining that the TLB miss does not exist, denying read access to prevent an attack that requires a modification of the NPT and triggering a page fault.

### Claim 10 (depends on 9)

The method according to claim 9, further comprising preventing a hypervisor from reading ciphertext in a memory region of the guest VM that comprises register values in a VM Save Area (VMSA) to infer plaintext therefrom.

### Claim 11 (depends on 9)

The system according to claim 9, wherein the memory page is validated prior to granting access to the guest physical address in the NPT to prevent the current user from modifying the RMP entry, thereby, maintaining a one-to-one mapping between the guest physical address and the system physical address.

### Claim 12 (depends on 11)

The system according to claim 11, wherein the RMP entry is indexed by one or more system page frame numbers and identifies the owner using at least one page state that comprises page ownership information.

### Claim 13 (depends on 11)

The system according to claim 11, wherein the RMP entry identifies the owner using at least one page state that comprises page ownership information.

### Claim 14 (depends on 9)

The system according to claim 9, further comprising, caching the address translation in the TLB entry for use in a subsequent access to the guest virtual address.

### Claim 15 (depends on 9)

The system according to claim 9, further comprising, in response to obtaining the address translation, saving the address translation in the TLB.

### Claim 16 (depends on 9)

The system according to claim 9, wherein the system physical address comprises a DRAM address.

### Claim 17

A non-transitory computer-readable medium or media comprising one or more sequences of instructions which, when executed by at least one processor, causes steps for reducing leakage of confidential information from guest virtual machine (VM) registers comprising:
in response to a current user attempting to access a memory page associated with a guest physical address of a guest VM, determining whether a Translation Look-aside Buffer (TLB) miss exists in a TLB that comprises a TLB entry, the TLB miss being indicative of an address translation from a guest virtual address to a system physical address not being present in the TLB entry; and
in response to determining that the TLB miss exists, using one or more processors to perform steps comprising:
performing a page table walk that uses page table entries in at least one of a guest page table or a nested page table (NPT) to obtain the address translation;
using a Reverse Map Table (RMP) entry, which identifies an owner of the memory page, to determine whether the current user is the owner of the memory page to validate the memory page;
in response to determining that the current user is the owner of the memory page, validating the memory page and granting read access to the current user to fetch the TLB entry from the TLB; and
otherwise, denying read access to prevent an attack that requires a modification of the NPT and triggering a page fault.

### Claim 18 (depends on 17)

The non-transitory computer-readable medium or media according to claim 17, wherein the memory page is validated prior to granting access to the guest physical address in the NPT to prevent the current user from modifying the RMP entry, thereby, maintaining a one-to-one mapping between the guest physical address and the system physical address.

### Claim 19 (depends on 17)

The non-transitory computer-readable medium or media according to claim 17, further comprising preventing the hypervisor from reading ciphertext in a memory region of the guest VM that comprises register values in a VM Save Area (VMSA) to infer plaintext therefrom.

### Claim 20 (depends on 17)

The non-transitory computer-readable medium or media according to claim 17, wherein the RMP entry is indexed by one or more system page frame numbers and identifies the owner using at least one page state that comprises page ownership information.
