IP Library Granted Patent US 11,573,713
Granted Patent B1
US 11,573,713 · App. 17/516,833 · Granted Feb 7, 2023

Identifying and preventing invalid memory access

Inventors: Punit B. Shah (Castro Valley, CA); Rui Zhang (San Francisco, CA); Rama K. Korlapati (El Segundo, CA); Prashasthi Prabhakar (San Bruno, CA); Dominique Jeremy Evans (San Francisco, CA)
Assignee: Salesforce, Inc.
G06F3/0622G06F3/0655G06F3/0679
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 11,573,713
App. No.
17/516,833
Granted
Feb 7, 2023
Kind
B1
Abstract

Methods, computer readable media, and devices for identifying and preventing invalid memory access. A method may include defining a dynamic scope for an operation, receiving a request to allocate a portion of the range of shared memory, allocating a monotonically increasing portion of the range of shared memory such that a subsequent request to allocate memory is allocated a different portion of the range of shared memory, receiving a request to deallocate the allocated portion of the range of shared memory, deallocating the allocated portion of the range of shared memory by protecting the deallocated portion of the range of shared memory from any subsequent access, and in response to an access of the protected deallocated portion of the range of shared memory by one of the one or more threads or processes of the operation, trapping and terminating the one thread or process.

Claims (60)

1. A computer-implemented method for identifying and preventing invalid memory access, the method comprising:

defining a dynamic scope for an operation,

the dynamic scope comprising a range of shared memory to be utilized by the operation; and

the operation comprising one or more threads or processes;

receiving a request to allocate a portion of the range of shared memory;

allocating a monotonically increasing portion of the range of shared memory such that a subsequent request to allocate memory is allocated a different portion of the range of shared memory;

receiving a request to deallocate the allocated portion of the range of shared memory;

deallocating the allocated portion of the range of shared memory, wherein deallocating the allocated portion comprises protecting the deallocated portion of the range of shared memory from any subsequent access; and

in response to an access of the protected deallocated portion of the range of shared memory by one of the one or more threads or processes of the operation, trapping and terminating the one thread or process.

2. The computer-implemented method of claim 1 , wherein the dynamic scope is an indication of a type of the operation.

3. The computer-implemented method of claim 2 , wherein the type of operation is selected from the list comprising:

an expression;

a statement;

a physical operator transaction; and

a client session.

4. The computer-implemented method of claim 1 , wherein protecting the deallocated portion of the range of shared memory from any subsequent access comprises utilizing an operating system level facility to manipulate memory access permissions.

5. The computer-implemented method of claim 1 , wherein protecting the deallocated portion of the range of shared memory from any subsequent access comprises utilizing a hardware level facility to manipulate memory access permissions.

6. The computer-implemented method of claim 1 , wherein trapping and terminating the one thread or process comprises generating a fault signal.

7. The computer-implemented method of claim 1 , further comprising:

in response to termination of the operation, removing any protection from the range of shared memory; and

for a subsequent operation having the same type of operation as the operation, defining a dynamic scope for the subsequent operation comprising the range of shared memory.

8. A non-transitory machine-readable storage medium that provides instructions that, if executed by a processor, are configurable to cause the processor to perform operations comprising:

defining a dynamic scope for an operation,

the dynamic scope comprising a range of shared memory to be utilized by the operation; and

the operation comprising one or more threads or processes;

receiving a request to allocate a portion of the range of shared memory;

allocating a monotonically increasing portion of the range of shared memory such that a subsequent request to allocate memory is allocated a different portion of the range of shared memory;

receiving a request to deallocate the allocated portion of the range of shared memory;

deallocating the allocated portion of the range of shared memory, wherein deallocating the allocated portion comprises protecting the deallocated portion of the range of shared memory from any subsequent access; and

in response to an access of the protected deallocated portion of the range of shared memory by one of the one or more threads or processes of the operation, trapping and terminating the one thread or process.

9. The non-transitory machine-readable storage medium of claim 8 , wherein the dynamic scope is an indication of a type of the operation.

10. The non-transitory machine-readable storage medium of claim 9 , wherein the type of operation is selected from the list comprising:

an expression;

a statement;

a physical operator transaction; and

a client session.

11. The non-transitory machine-readable storage medium of claim 8 , wherein protecting the deallocated portion of the range of shared memory from any subsequent access comprises utilizing an operating system level facility to manipulate memory access permissions.

12. The non-transitory machine-readable storage medium of claim 8 , wherein protecting the deallocated portion of the range of shared memory from any subsequent access comprises utilizing a hardware level facility to manipulate memory access permissions.

13. The non-transitory machine-readable storage medium of claim 8 , wherein trapping and terminating the one thread or process comprises generating a fault signal.

14. The non-transitory machine-readable storage medium of claim 8 , wherein performed operations further comprise:

in response to termination of the operation, removing any protection from the range of shared memory; and

for a subsequent operation having the same type of operation as the operation, defining a dynamic scope for the subsequent operation comprising the range of shared memory.

15. An apparatus comprising:

a processor; and

a non-transitory machine-readable storage medium that provides instructions that, if executed by a processor, are configurable to cause the processor to perform operations comprising:

defining a dynamic scope for an operation,

the dynamic scope comprising a range of shared memory to be utilized by the operation; and

the operation comprising one or more threads or processes;

receiving a request to allocate a portion of the range of shared memory;

allocating a monotonically increasing portion of the range of shared memory such that a subsequent request to allocate memory is allocated a different portion of the range of shared memory;

receiving a request to deallocate the allocated portion of the range of shared memory;

deallocating the allocated portion of the range of shared memory, wherein deallocating the allocated portion comprises protecting the deallocated portion of the range of shared memory from any subsequent access; and

in response to an access of the protected deallocated portion of the range of shared memory by one of the one or more threads or processes of the operation, trapping and terminating the one thread or process.

16. The apparatus of claim 15 , wherein the dynamic scope is an indication of a type of the operation.

17. The apparatus of claim 15 , wherein protecting the deallocated portion of the range of shared memory from any subsequent access comprises utilizing an operating system level facility to manipulate memory access permissions.

18. The apparatus of claim 15 , wherein protecting the deallocated portion of the range of shared memory from any subsequent access comprises utilizing a hardware level facility to manipulate memory access permissions.

19. The apparatus of claim 15 , wherein trapping and terminating the one thread or process comprises generating a fault signal.

20. The apparatus of claim 15 , wherein performed operations further comprise:

in response to termination of the operation, removing any protection from the range of shared memory; and

for a subsequent operation having the same type of operation as the operation, defining a dynamic scope for the subsequent operation comprising the range of shared memory.

Assignments (2)
CHANGE OF NAME Recorded Dec 18, 2024
From: SALESFORCE.COM, INC.
To: SALESFORCE, INC.
Reel/Frame 069717/0571 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Nov 2, 2021
From: SHAH, PUNIT B.; ZHANG, RUI; KORLAPATI, RAMA K.; PRABHAKAR, PRASHASTHI; EVANS, DOMINIQUE JEREMY
To: SALESFORCE.COM, INC.
Reel/Frame 057991/0143 →
Cited By (1)
US 12,405,927