IP Library Granted Patent US 10,810,305
Granted Patent B2
US 10,810,305 · App. 15/899,229 · Granted Oct 20, 2020

Securing untrusted code using memory protection key and control flow integrity

Inventors: Mingwei Zhang (Hillsboro, OR); Ravi Sahita (Portland, OR)
Assignee: Intel Corporation
G06F21/53G06F3/0637G06F9/3005G06F12/14G06F21/52G06F21/54
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 10,810,305
App. No.
15/899,229
Granted
Oct 20, 2020
Kind
B2
Abstract

Systems, apparatuses and methods may provide technology for securing untrusted code using memory protection keys and control flow integrity, by applying a memory protection key to one or more memory regions, enforcing control flow integrity with respect to the one or more memory regions, and executing untrusted code in an isolated region of the one or more memory regions.

Claims (50)

1. A system comprising:

an isolated region among one or more memory regions; and

a semiconductor hardware device, the semiconductor hardware device comprising:

one or more substrates; and

logic coupled to one or more substrates, wherein the logic is implemented at least partly in one or more of configurable logic or fixed-functionality hardware logic, the logic coupled to the one or more substrates to:

apply a memory protection key to one or more memory regions;

enforce control flow integrity with respect to the one or more memory regions; and

execute untrusted code in an isolated region of the one or more memory regions,

wherein the logic coupled to the one or more substrates is to enable execution of trusted code outside of the isolated region,

wherein each of the trusted code and the untrusted code reachable via an indirect branch include an endbranch instruction to mark a beginning of code path, and

wherein a memory read instruction is added after each endbranch instruction.

2. The system according to claim 1 , wherein the logic coupled to the one or more substrates is to modify memory protection key permissions to update the untrusted code.

3. The system according to claim 1 , wherein the logic coupled to the one or more substrates is to prevent the untrusted code from accessing external memory and prevents execution of the untrusted code outside of the isolated region.

4. The system according to claim 1 , wherein the logic coupled to the one or more substrates is to restrict control transfers between the untrusted code and the trusted code via a trampoline code path in trampoline memory regions.

5. The system according to claim 1 , wherein the memory protection key is to be applied to at least one code and data memory region of both the untrusted code and the trusted code.

6. The system according to claim 1 , wherein the untrusted code and the trusted code are to be control-flow-integrity enforcement instruction enabled.

7. The system according to claim 1 , wherein the logic coupled to the one or more substrates includes transistor channel regions that are positioned within the one or more substrates.

8. A semiconductor package apparatus comprising:

one or more substrates; and

logic coupled to the one or more substrates, wherein the logic is implemented at least partly in one or more of configurable logic or fixed-functionality hardware logic, the logic coupled to the one or more substrates to:

apply a memory protection key to one or more memory regions;

enforce control flow integrity with respect to the one or more memory regions; and

execute untrusted code in an isolated region of the one or more memory regions,

wherein the logic coupled to the one or more substrates is to enable execution of trusted code outside of the isolated region,

wherein each of the trusted code and the untrusted code reachable via an indirect branch include an endbranch instruction to mark a beginning of a code path, and

wherein a memory read instruction is added after each endbranch instruction.

9. The semiconductor package apparatus according to claim 8 , wherein the logic coupled to the one or more substrates is to modify memory protection key permissions to update the untrusted code.

10. The semiconductor package apparatus according to claim 8 , wherein the logic coupled to the one or more substrates is to prevent the untrusted code from accessing external memory and prevents execution of the untrusted code outside of the isolated region.

11. The semiconductor package apparatus according to claim 8 , wherein the logic coupled to the one or more substrates is to restrict control transfers between the untrusted code and the trusted code via a trampoline code path in trampoline memory regions.

12. The semiconductor package apparatus according to claim 8 , wherein the memory protection key is to be applied to at least one code and data memory region of both the untrusted code and the trusted code.

13. The semiconductor package apparatus according to claim 8 , wherein the untrusted code and the trusted code are to be control-flow-integrity enforcement instruction enabled.

14. The semiconductor package apparatus of claim 8 , wherein the logic coupled to the one or more substrates includes transistor channel regions that are positioned within the one or more substrates.

15. A method comprising:

applying a memory protection key to one or more memory regions;

enforcing control flow integrity with respect to the one or more memory regions;

executing untrusted code in an isolated region of the one or more memory regions;

enabling execution of trusted code outside of the isolated region;

providing an endbranch instruction to mark a beginning of a code path at each of the trusted code and the untrusted code reachable via an indirect branch; and

adding a memory read instruction after each endbranch instruction.

16. The method according to claim 15 , further comprising updating the untrusted code by modifying memory protection key permissions.

17. The method according to claim 15 , wherein the untrusted code that is to be executed in the isolated region cannot access external memory and cannot be executed outside of the isolated region.

18. At least one non-transitory computer readable storage medium comprising a set of instructions, which when executed by a computing device, cause the computing device to:

apply a memory protection key to one or more memory regions;

enforce control flow integrity with respect to the one or more memory regions;

execute untrusted code in an isolated region of the one or more memory regions;

enable execution of trusted code outside of the isolated region;

provide an endbranch instruction to mark a beginning of a code path at each of the trusted code and the untrusted code reachable via an indirect branch; and

add a memory read instruction after each endbranch instruction.

19. The at least one non-transitory computer readable storage of claim 18 , wherein the computing device is to update the untrusted code by modifying memory protection key permissions.

20. The at least one non-transitory computer readable storage of claim 18 , wherein the untrusted code that is to be executed in the isolated region cannot access external memory and cannot be executed outside of the isolated region.

Assignments (2)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Apr 2, 2026
From: INTEL CORPORATION
To: TENSTORRENT USA, INC.
Reel/Frame 074264/0335 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Feb 21, 2018
From: ZHANG, MINGWEI; SAHITA, RAVI
To: INTEL CORPORATION
Reel/Frame 045400/0513 →