# US 9,355,262 B2 · Modifying memory permissions in a secure processing environment

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

- Number: US 9,355,262 B2
- Document ID: US9355262B2
- Status: Granted
- Kind: B2
- Application number: 14/141,941
- Filed: 2013-12-27
- Published: 2015-07-02
- Granted: 2016-05-31
- Earliest claimed: 2013-12-27
- Assignees: Intel Corporation
- Applicants: Intel Corporation
- Inventors: Rebekah Leslie-Hurd; Ilya Alexandrovich; Ittai Anati; Alex Berenzon; Michael Goldsmith; Simon Johnson; Francis McKeen; Carlos Rozas; Uday Savagaonkar; Vincent Scarlata; Vedvyas Shanbhogue; Wesley Smith
- Web page: https://patentgrep.com/patent/US9355262B2

## CPC

- G06F 21/604: {Tools and structures for managing or administering access control systems}
- G06F 9/3004: {to perform operations on memory}
- G06F 12/0875: with dedicated cache, e.g. instruction or stack
- G06F 12/145: {the protection being virtual, e.g. for virtual blocks or segments before a translation mechanism}
- G06F 12/1466: {Key-lock mechanism}
- G06F 12/1491: {in a hierarchical protection system, e.g. privilege levels, memory rings}
- G06F 21/53: by executing in a restricted environment, e.g. sandbox or secure virtual machine
- G06F 21/72: in cryptographic circuits
- G06F 21/78: to assure secure storage of data (address-based protection against unauthorised use of memory G06F12/14; record carriers for use with machines and with at least a part designed to carry digital markings G06K19/00)
- G06F 2221/2141: Access rights, e.g. capability lists, access control lists, access tables, access matrices
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Embodiments of an invention for modifying memory permissions in a secure processing environment are disclosed. In one embodiment, a processor includes an instruction unit and an execution unit. The instruction unit is to receive an instruction to modify access permissions for a page in a secure enclave. The execution unit is to execute the instruction. Execution of the instruction includes setting new access permissions in an enclave page cache map entry. Furthermore, the page is immediately accessible from inside the secure enclave according to the new access permissions.

## Claims

### Claim 1

A processor comprising:
instruction hardware to receive a first instruction and a second instruction, wherein the first instruction is to extend access permissions for a page in a secure enclave and the second instruction is to be called, by an application from within the secure enclave, an operating system outside the secure enclave to invoke the second instruction to restrict access permissions for the page;
execution hardware to execute the first instruction and the second instruction, wherein execution of the first instruction and the second instruction includes changing at least one of a read, write, and execute access permission in an enclave page cache map entry without setting a modified bit in the enclave page cache map entry, wherein execution of the second instruction includes storing an enclave epoch value in the enclave page cache map entry, and wherein the page is immediately accessible from inside the secure enclave according to the changed access permissions; and
a translation lookaside buffer, wherein the operating system is to track enclave threads with translation lookaside buffer entries made stale by the changed access permissions and send interprocessor interrupts to trigger enclave thread exits and a translation lookaside buffer shootdown.

### Claim 2 (depends on 1)

The processor of claim 1, wherein the first instruction is executable from within the secure enclave.

### Claim 3 (depends on 2)

The processor of claim 2, wherein the first instruction is executable only from within the secure enclave.

### Claim 4 (depends on 1)

The processor of claim 1, wherein the second instruction is executable only in supervisor mode.

### Claim 5

A method comprising:
issuing a first instruction to a hardware processor to extend access permission for a page in a secure enclave; and
executing, by the hardware processor, the first instruction, wherein execution of the first instruction includes changing at least one of a read, write, and execute access permission in an enclave page cache map entry without setting a modified bit in the enclave page cache map entry, and wherein the page is immediately accessible from inside the secure enclave according to the changed access permissions;
calling, by an application from within the secure enclave, an operating system outside the secure enclave to invoke a second instruction to restrict at least one access permission for the page;
issuing the second instruction to the hardware processor to restrict the at least one access permission for the page;
executing, by the hardware processor, the second instruction, wherein execution of the second instruction includes changing at least one of the read, write, and execute access permission in the enclave page cache map entry, and storing an enclave epoch value in the enclave page cache map entry, and wherein the page is immediately accessible from inside the secure enclave according to the changed access permissions;
tracking, by the operating system, enclave threads with translation lookaside buffer entries made stale by the changed access permissions; and
sending, by the operating system, interprocessor interrupts to trigger enclave thread exits and a translation lookaside buffer shootdown.

### Claim 6 (depends on 5)

The method of claim 5, further comprising:
accessing, by an application from within the secure enclave, the page according to the changed access permissions, and
updating, by an operating system from outside the secure enclave, page tables to reflect the changed access permissions.

### Claim 7 (depends on 5)

The method of claim 5, further comprising:
attempting, by an application from within the secure enclave, to access the page after execution of the first instruction;
determining, by the hardware processor, that a mapping for the page exists in a translation lookaside buffer; and
causing, by the hardware processor, a page fault and an asynchronous exit from the secure enclave.

### Claim 8 (depends on 7)

The method of claim 7, further comprising:
handling, by an operating system from outside the secure enclave, the page fault; and
restarting, by the operating system, the application in the secure enclave.

### Claim 9 (depends on 5)

The method of claim 5, further comprising verifying, by the application from within the secure enclave, that the changed access permissions have been set.

### Claim 10

A system comprising:
a memory; and
a processor including instruction hardware to receive a first instruction and a second instruction, wherein the first instruction is to extend access permissions for a page loaded from the memory into a secure enclave and the second instruction is to be called, by an application from within the secure enclave, an operating system outside the secure enclave to invoke the second instruction to restrict access permissions for the page;
execution hardware to execute the first instruction and the second instruction, wherein execution of the first instruction and the second instruction includes changing at least one of a read, write, and execute access permission in an enclave page cache map entry without setting a modified bit in the enclave page map entry, wherein execution of the second instruction includes storing an enclave epoch value in the enclave page cache map entry, and wherein the page is immediately accessible from inside the secure enclave according to the changed access permissions; and
a translation lookaside buffer, wherein the operating system is to track enclave threads with translation lookaside buffer entries made stale by the changed access permissions and send interprocessor interrupts to trigger enclave thread exits and a translation lookaside buffer shootdown.
