# US 2019/0243966 A1 · Dynamic binary translation to secure processes from speculative rogue cache loads

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

- Number: US 2019/0243966 A1
- Document ID: US20190243966A1
- Status: Published application
- Kind: A1
- Application number: 16/004,191
- Filed: 2018-06-08
- Published: 2019-08-08
- Earliest claimed: 2018-02-06
- Assignees: VMware, Inc.
- Applicants: VMware, Inc.
- Inventors: Michael Wei; Dan Tsafrir; Nadav Amit
- Web page: https://patentgrep.com/patent/US20190243966A1

## CPC

- G06F 21/54: by adding security routines or objects to programs
- G06F 9/461: {Saving or restoring of program or task context}
- G06F 12/0615: {Address space extension}
- G06F 12/1009: using page tables, e.g. page table structures
- G06F 12/1036: for multiple virtual address spaces, e.g. segmentation (G06F12/1045 takes precedence)
- G06F 12/1441: {for a range}
- G06F 21/52: during program execution, e.g. stack integrity {; Preventing unwanted data erasure; Buffer overflow}
- G06F 21/577: {Assessing vulnerabilities and evaluating computer system security}
- G06F 21/74: operating in dual or compartmented mode, i.e. at least one secure mode
- G06F 2212/1044: Space efficiency improvement
- G06F 2212/1052: Security improvement
- G06F 2212/151: Emulated environment, e.g. virtual machine
- G06F 2212/502: using adaptive policy
- G06F 2212/657: Virtual address space management
- G06F 2221/034: Test or assess a computer or a system
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

In accordance with embodiments of the present disclosure, a binary translator can perform address shifting on the binary code of an executing application. Address shifting serves to shift the addresses of memory operations that can access locations in the kernel address space into address locations in the user space, thus avoiding speculative access into the kernel address space.

## Claims

### Claim 1

A method for executing an application by a central processing unit (CPU) in a computer system, the method comprising:
accessing, by the computer system, a code page of the application from a physical memory of the computer system, the accessed code page comprising computer executable instructions to be executed by the CPU;
rewriting, by the computer system, the accessed code page to produce a rewritten code page, including:
copying computer executable instructions in the accessed code page to the rewritten code page; and
in response to a computer executable instruction being a memory operation, writing address shifting code associated with the memory operation to the rewritten code page followed by writing the memory operation to the rewritten code page; and
executing, by the computer system, computer executable instructions in the rewritten code page instead of executing computer executable instructions in the accessed code page.

### Claim 2 (depends on 1)

The method of claim 1, wherein rewriting the accessed code page further includes rewriting a memory operation to produce a replacement memory operation and writing the replacement memory operation to the rewritten code page.

### Claim 3 (depends on 1)

The method of claim 1, wherein the accessed code page is marked for non-execution, wherein the rewritten code page is marked for execution.

### Claim 4 (depends on 1)

The method of claim 1, wherein rewriting the accessed code page to produce a rewritten code page occurs in response to a first occurrence of an access to a computer executable instruction in the accessed code page.

### Claim 5 (depends on 1)

The method of claim 1, wherein for each memory operation in the rewritten code page, its associated address shifting code is inserted immediately prior in sequence to that memory operation.

### Claim 6 (depends on 1)

The method of claim 1, wherein, for each memory operation, its associated address shifting code masks out a range of addresses that belong to a kernel address space in a virtual address space of the computer executable machine instructions to prevent access to a kernel address space by that memory operation.

### Claim 7

A non-transitory computer-readable storage medium having stored thereon computer executable instructions, which when executed by a computer device, cause the computer device to:
access a code page of the application from a physical memory of the computer system, the accessed code page comprising computer executable instructions to be executed by the CPU;
rewrite the accessed code page to produce a rewritten code page, including:
copying computer executable instructions in the accessed code page to the rewritten code page; and
in response to a computer executable instruction being a memory operation, writing address shifting code associated with the memory operation to the rewritten code page followed by writing the memory operation to the rewritten code page; and
execute computer executable instructions in the rewritten code page instead of executing computer executable instructions in the accessed code page.

### Claim 8 (depends on 7)

The non-transitory computer-readable storage medium of claim 7, wherein rewriting the accessed code page further includes rewriting a memory operation to produce a replacement memory operation and writing the replacement memory operation to the rewritten code page.

### Claim 9 (depends on 7)

The non-transitory computer-readable storage medium of claim 7, wherein the accessed code page is marked for non-execution, wherein the rewritten code page is marked for execution.

### Claim 10 (depends on 7)

The non-transitory computer-readable storage medium of claim 7, wherein rewriting the accessed code page to produce a rewritten code page occurs in response to a first occurrence of an access to a computer executable instruction in the accessed code page.

### Claim 11 (depends on 7)

The non-transitory computer-readable storage medium of claim 7, wherein for each memory operation in the rewritten code page, its associated address shifting code is inserted immediately prior in sequence to that memory operation.

### Claim 12 (depends on 7)

The non-transitory computer-readable storage medium of claim 7, wherein, for each memory operation, its associated address shifting code masks out a range of addresses that belong to a kernel address space in a virtual address space of the computer executable machine instructions to prevent access to a kernel address space by that memory operation.

### Claim 13

An apparatus comprising:
one or more computer processors; and
a computer-readable storage medium comprising instructions for controlling the one or more computer processors to be operable to:
access a code page of the application from a physical memory of the computer system, the accessed code page comprising computer executable instructions to be executed by the CPU;
rewrite the accessed code page to produce a rewritten code page, including:
copying computer executable instructions in the accessed code page to the rewritten code page; and
in response to a computer executable instruction being a memory operation, writing address shifting code associated with the memory operation to the rewritten code page followed by writing the memory operation to the rewritten code page; and
execute computer executable instructions in the rewritten code page instead of executing computer executable instructions in the accessed code page.

### Claim 14 (depends on 13)

The apparatus of claim 13, wherein rewriting the accessed code page further includes rewriting a memory operation to produce a replacement memory operation and writing the replacement memory operation to the rewritten code page.

### Claim 15 (depends on 13)

The apparatus of claim 13, wherein the accessed code page is marked for non-execution, wherein the rewritten code page is marked for execution.

### Claim 16 (depends on 13)

The apparatus of claim 13, wherein rewriting the accessed code page to produce a rewritten code page occurs in response to a first occurrence of an access to a computer executable instruction in the accessed code page.

### Claim 17 (depends on 13)

The apparatus of claim 13, wherein for each memory operation in the rewritten code page, its associated address shifting code is inserted immediately prior in sequence to that memory operation.

### Claim 18 (depends on 13)

The apparatus of claim 13, wherein, for each memory operation, its associated address shifting code masks out a range of addresses that belong to a kernel address space in a virtual address space of the computer executable machine instructions to prevent access to a kernel address space by that memory operation.
