IP Library › Granted Patent US 12,182,317
Granted Patent B2
US 12,182,317 · App. 17/357,963 · Granted Dec 31, 2024

Region-based deterministic memory safety

Inventors: Michael LeMay (Hillsboro, OR); David M. Durham (Beaverton, OR)
Assignee: Intel Corporation
G06F21/79G06F12/0871G06F12/0882G06F21/554G06F21/556G06F21/602
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 12,182,317
App. No.
17/357,963
Granted
Dec 31, 2024
Kind
B2
Abstract

Methods and apparatus relating to techniques for region-based deterministic memory safety are described. In some embodiment, one or more instructions may be used to encrypt, decrypt, and/or check a pointer to a portion of the data stored in memory. The portion of the data is stored in a first region of the memory. The first region of the memory includes a plurality of identically sized allocation slots. Other embodiments are also disclosed and claimed.

Claims (40)

1. An apparatus comprising:

memory to store data;

decode circuitry to decode an instruction, the instruction to include a source operand; and

execution circuitry to execute the decoded instruction according to the source operand to encrypt a pointer to a portion of the data stored in the memory, wherein the portion of the data is to be stored in a first region of the memory,

wherein the first region of the memory includes a plurality of identically sized allocation slots, wherein each slot of the plurality of identically sized allocation slots is to store per-allocation metadata, wherein the per-allocation metadata comprises allocation type information, allocation bounds information, and a reference counter.

2. The apparatus of claim 1 , wherein the execution circuitry is to determine whether the pointer is within spatial bounds for a referenced allocation.

3. The apparatus of claim 1 , wherein the decode circuitry is to decode a second instruction, the second instruction to include at least one source operand, wherein the execution circuitry is to execute the decoded second instruction according to the at least one source operand to decrypt the encrypted pointer.

4. The apparatus of claim 3 , wherein the execution circuitry is to execute the decoded second instruction to determine whether the decrypted pointer is canonical.

5. The apparatus of claim 1 , wherein each slot of the plurality of identically sized allocation slots is to store a single allocation.

6. The apparatus of claim 1 , wherein each slot of the plurality of identically sized allocation slots is to store a single allocation and the per-allocation metadata.

7. The apparatus of claim 1 , wherein the per-allocation metadata further comprises an allocation type identifier, wherein a comparison of the allocation type identifier is to mitigate type confusion.

8. The apparatus of claim 1 , wherein the execution circuitry is to consult a page table entry to determine a size and an offset for the plurality of identically sized allocation slots on a page.

9. An apparatus comprising:

memory to store data;

decode circuitry to decode an instruction, the instruction to include a source operand; and

execution circuitry to execute the decoded instruction according to the source operand to decrypt a pointer to a portion of the data stored in the memory,

wherein the portion of the data is to be stored in a first region of the memory, wherein the first region of the memory includes a plurality of identically sized allocation slots, wherein each slot of the plurality of identically sized allocation slots is to store per-allocation metadata, wherein the per-allocation metadata comprises allocation type information, allocation bounds information, and a reference counter.

10. The apparatus of claim 9 , wherein the execution circuitry is to determine whether the decrypted pointer is canonical.

11. The apparatus of claim 9 , wherein each slot of the plurality of identically sized allocation slots is to store a single allocation.

12. The apparatus of claim 9 , wherein each slot of the plurality of identically sized allocation slots is to store a single allocation and the per-allocation metadata.

13. The apparatus of claim 10 , wherein an exception is to be generated in response to a determination that a portion of an attempted access is outside of bounds of a slot containing an allocation that the pointer is authorized to reference.

14. An apparatus comprising:

memory to store data;

decode circuitry to decode an instruction, the instruction to include a first operand; and

execution circuitry to execute the decoded instruction according to the first operand to determine a slot for an original pointer,

wherein the original pointer is to point to a portion of the data stored in the memory, wherein the portion of the data is to be stored in a first region of the memory, wherein the first region of the memory includes a plurality of identically sized allocation slots, wherein each slot of the plurality of identically sized allocation slots is to store per-allocation metadata, wherein the per-allocation metadata comprises allocation type information, allocation bounds information, and a reference counter.

15. The apparatus of claim 14 , where the execution circuitry is to determine whether the original pointer is poisoned.

16. The apparatus of claim 15 , where the execution circuitry is to determine a location of the poisoned original pointer.

17. The apparatus of claim 14 , wherein each slot of the plurality of identically sized allocation slots is to store a single allocation.

18. The apparatus of claim 14 , wherein each slot of the plurality of identically sized allocation slots is to store a single allocation and the per-allocation metadata.

19. The apparatus of claim 14 , wherein the original pointer is unencrypted.

20. One or more non-transitory computer-readable media comprising one or more instructions that when executed on a processor configure the processor to perform one or more operations to:

store data in memory;

decode an instruction, the instruction to include a source operand; and

execute the decoded instruction according to the source operand to encrypt a pointer to a portion of the data stored in the memory, wherein the portion of the data is to be stored in a first region of the memory, wherein the first region of the memory includes a plurality of identically sized allocation slots, wherein each slot of the plurality of identically sized allocation slots is to store per-allocation metadata, wherein the per-allocation metadata comprises allocation type information, allocation bounds information, and a reference counter.

21. The one or more computer-readable media of claim 20 , further comprising one or more instructions that when executed on the at least one processor configure the at least one processor to perform one or more operations to cause determination of whether the pointer is within a spatial bounds for a referenced allocation.

22. The one or more computer-readable media of claim 20 , further comprising one or more instructions that when executed on the at least one processor configure the at least one processor to perform one or more operations to cause decoding of a second instruction, the second instruction to include at least one source operand, and to cause execution of the decoded second instruction according to the at least one source operand to decrypt the encrypted pointer.

23. The apparatus of claim 9 , wherein the per-allocation metadata further comprises an allocation type identifier, wherein a comparison of the allocation type identifier is to mitigate type confusion.

24. The apparatus of claim 14 , wherein the per-allocation metadata further comprises an allocation type identifier, wherein a comparison of the allocation type identifier is to mitigate type confusion.

25. The one or more computer-readable media of claim 20 , wherein the per-allocation metadata further comprises an allocation type identifier, further comprising one or more instructions that when executed on the at least one processor configure the at least one processor to perform one or more operations to cause a comparison of the allocation type identifier to mitigate type confusion.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jul 12, 2021
From: LEMAY, MICHAEL; DURHAM, DAVID M.
To: INTEL CORPORATION
Reel/Frame 056823/0620 →
Continuity (2)
Provisional Application 63149271 · Feb 13, 2021
Related Publication 20220261509A1 · Aug 18, 2022
Cited By (2)
US 12,487,822 US 12,504,891