IP Library Granted Patent US 8,156,385
Granted Patent B2
US 8,156,385 · App. 12/607,625 · Granted Apr 10, 2012

Systems and methods for backward-compatible constant-time exception-protection memory

Assignee: International Business Machines Corporation
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 8,156,385
App. No.
12/607,625
Granted
Apr 10, 2012
Kind
B2
Abstract

Embodiments of the invention provide a table-free technique for detecting all temporal and spatial memory access errors in programs supporting general pointers. Embodiments of the invention provide such error checking using constant-time operations. Embodiments of the invention rely on fat pointers, whose size is contained within standard scalar sizes (up to two words) so that atomic hardware support for operations upon the pointers is obtained along with meaningful casts in-between pointers and other scalars. Optimized compilation of code becomes possible since the scalarized-for-free encoded pointers get register allocated and manipulated. Backward compatibility is enabled by the scalar pointer sizes, with automatic support provided for encoding and decoding of fat pointers in place for interaction with unprotected code.

Claims (42)

1. A method comprising:

utilizing one or more processors to execute a program of instructions, the program of instructions comprising computer readable program code configured to:

in programs supporting general pointers, detect all types of temporal and spatial memory access errors, including uninitialized memory accesses;

wherein all types of temporal and spatial memory access errors are checked in constant time;

wherein coverage of said uninitialized memory accesses is complete for small allocations and is approximate otherwise; and

wherein coverage of all other memory errors is complete within constant time.

2. The method according to claim 1 , wherein the computer readable program code is further configured to utilize fat pointers of scalar size to provide backward compatibility support.

3. The method according to claim 2 , wherein to provide backward compatibility support further comprises providing support for encoding and decoding of pointers.

4. The method according to claim 2 , wherein the scalar size is two words.

5. The method according to claim 2 , wherein the scalar size is one word such that an encoded general pointer has a same scalar size as an un-encoded pointer.

6. The method according to claim 1 , wherein the computer readable program code is further configured to utilize an object version that is stored with an object itself and thus is available in cache with the object for lookup within constant time.

7. The method according to claim 6 , wherein said object version is represented as a bitfield within a word that effectively contains a base address of a referent as an offset into a pre-allocated protected heap; and wherein one word is saved for capabilities without compromising on capability space size.

8. The method of claim 7 , wherein encoding pointers as offsets into a pre-allocated heap reduces a space requirement of pointers to an offset bitfield, enabling remaining bits to be used for encoding meta-data.

9. The method according to claim 1 , wherein said all types of temporal and spatial memory access errors are detected at memory block level except for uninitialized data reads; and

wherein said uninitialized data reads are flagged.

10. The method according to claim 1 , wherein an explicit NULL pointer dereference check is subsumed and eliminated by a standard spatial check via use of a special NULL object, thereby minimizing run-time checks and costs.

11. An apparatus comprising:

one or more processors; and

a computer readable storage medium having computer readable program code embodied therewith and executable by the one or more processors, the computer readable program code comprising:

computer readable program code configured to, in programs supporting general pointers, detect all types of temporal and spatial memory access errors, including uninitialized memory accesses;

wherein all types of temporal and spatial memory access errors are checked in constant time;

wherein coverage of said uninitialized memory accesses is complete for small allocations and is approximate otherwise; and

wherein coverage of all other memory errors is complete within constant time.

12. The apparatus according to claim 11 , wherein the computer readable program code is further configured to utilize fat pointers of scalar size to provide backward compatibility support.

13. The apparatus according to claim 11 , wherein to provide backward compatibility support further comprises providing support for encoding and decoding of pointers.

14. The apparatus according to claim 13 , wherein the scalar size is two words.

15. The apparatus according to claim 13 , wherein the scalar size is one word such that an encoded general pointer has a same scalar size as an un-encoded pointer.

16. The apparatus according to claim 11 , wherein the computer readable program code is further configured to utilize an object version that is stored with an object itself and thus is available in cache with the object for lookup within constant time.

17. The apparatus according to claim 16 , wherein said object version is represented as a bitfield within a word that effectively contains a base address of a referent as an offset into a pre-allocated protected heap; and wherein one word is saved for capabilities without compromising on capability space size.

18. The apparatus according to claim 17 , wherein encoding pointers as offsets into a pre-allocated heap reduces a space requirement of pointers to an offset bitfield, enabling remaining bits to be used for encoding meta-data.

19. The apparatus according to claim 11 , wherein said all types of temporal and spatial memory access errors are detected at memory block level except for uninitialized data reads; and

wherein said uninitialized data reads are flagged.

20. The apparatus according to claim 11 , wherein an explicit NULL pointer dereference check is subsumed and eliminated by a standard spatial check via use of a special NULL object, thereby minimizing run-time checks and costs.

21. A computer program product comprising:

a computer readable storage medium having computer readable program code embodied therewith, the computer readable program code comprising:

computer readable program code configured to, in programs supporting general pointers, detect all types of temporal and spatial memory access errors, including uninitialized memory accesses;

wherein all types of temporal and spatial memory access errors are checked in constant time;

wherein coverage of said uninitialized memory accesses is complete for small allocations and is approximate otherwise; and

wherein coverage of all other memory errors is complete within constant time.

22. The computer program product according to claim 21 , wherein the computer readable program code is further configured to utilize fat pointers of scalar size to provide backward compatibility support.

23. The computer program product according to claim 21 , wherein the computer readable program code is further configured to utilize an object version that is stored with an object itself and thus is available in cache with the object for lookup within constant time.

24. The computer program product according to claim 23 , wherein said object version is represented as a bitfield within a word that effectively contains a base address of a referent as an offset into a pre-allocated protected heap; and wherein one word is saved for capabilities without compromising on capability space size.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jan 14, 2010
From: VARMA, PRADEEP; SHYAMASUNDAR, RUDRAPATNA K.; SHAH, HARSHIT J.
To: INTERNATIONAL BUSINESS MACHINES CORPORATION
Reel/Frame 023784/0034 →
Continuity (1)
Related Publication 20110099429A1 · Apr 28, 2011