IP Library Granted Patent US 9,069,656
Granted Patent B2
US 9,069,656 · App. 13/631,851 · Granted Jun 30, 2015

Obfuscating function resources while reducing stack consumption

Inventors: Jonathan G. McLachlan (San Francisco, CA); Julien Lerouge (San Jose, CA); Nicholas T. Sullivan (San Francisco, CA)
Assignee: Apple Inc.
G06F12/023G06F2212/1052G06F21/14G06F21/54G06F21/79G06F2221/2107G06F8/41
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 9,069,656
App. No.
13/631,851
Granted
Jun 30, 2015
Kind
B2
Abstract

In one embodiment, a system wide static global stack pool in a contiguous range of random access memory is generated, a block of memory in the system global pool is assigned to a thread of a running process, and the thread stores local variable information in static global stack pool, such that the local variable is hidden from a stack frame back-trace. In one embodiment, a dynamically allocated data structure in system heap memory is generated, the data structure is locked to ensure atomic access, a block of memory in the data structure is assigned to a thread of a process, the data structure is unlocked, and the thread stores local variable information in static global stack pool, such that the local variable is hidden from a stack frame back-trace.

Claims (57)

1. A non-transitory computer-readable medium with instructions stored therein, the instructions, when executed by a processing system, cause the processing system to perform operations, the operations comprising:

statically pre-allocating a system global memory pool in a contiguous range of random access memory;

assigning a block of memory in the system global memory pool to an execution thread of a process having a virtual memory range; and

storing a local variable of a function of the thread in the block of memory, wherein the local variable is stored outside of the virtual memory range of the process and is hidden from a stack frame back-trace.

2. The computer-readable medium as in claim 1 , wherein statically pre-allocating a system global memory pool comprises allocating memory from a secure memory region.

3. The computer-readable medium as in claim 1 , further comprising:

dynamically allocating a data structure in system memory;

locking the data structure to ensure atomic access;

assigning a block of memory in the data structure to a thread of the process; and

unlocking the data structure.

4. The computer-readable medium as in claim 3 , wherein the local variable of a function is hidden from a stack frame back-trace by modifying machine code of the process.

5. The computer-readable medium as in claim 4 , further comprising dynamically allocating additional space in the data structure.

6. The computer-readable medium as in claim 5 , further comprising storing function linkage data in the block of memory.

7. The computer-readable medium as in claim 6 , further comprising storing a process data segment in the block of memory.

8. A computer-implemented method at a data processing system, the method comprising:

statically pre-allocating a global memory pool in a contiguous range of random access memory;

assigning a first block of memory in the pre-allocated memory pool to the main thread of a process having a virtual memory range;

storing a local variable of a function of the main thread in the block of memory, wherein the local variable is hidden from a stack frame back-trace;

dynamically allocating a data structure in system memory;

locking the data structure to ensure atomic access;

assigning a second block of memory in the data structure to a second thread of a process;

unlocking the data structure; and

storing a local variable of a function of the second thread in the block of memory,

wherein the local variable is stored outside of the process virtual memory range.

9. The method as in claim 8 , further comprising storing function linkage data in the first or second block of memory.

10. The method as in claim 9 , further comprising storing a process data segment in the first or second block of memory.

11. A computer-implemented method at a data processing system, the method comprising generating machine code on a non-transitory computer readable medium for a program written in a high level language, the machine code to perform operations comprising:

dynamically allocating, a first data structure in system memory;

requesting a lock of the data structure to ensure atomic access;

requesting a first block of memory in the data structure;

assigning the first block of memory to a stack frame of a function in an application;

releasing the lock on the data structure; and

storing a local variable of a function in the block of requested memory, such that the local variable is hidden from a stack frame back-trace.

12. The computer-implemented method as in claim 11 , further comprising:

requesting an allocation on a first dynamically allocated data structure;

dynamically allocating a second data structure in system memory when the first data structure is full; and

linking the first data structure to the second data structure.

13. The computer-implemented method as in claim 12 , further comprising:

requesting, through a runtime system programming interface, a memory allocation on a system global stack pool;

assigning the allocated memory to a stack frame of a function in an application; and

storing a local variable of the function in allocated memory, such that the local variable is hidden from a stack frame back-trace.

14. A non-transitory computer-readable medium with instructions stored therein, the instructions, when executed by a processing system, cause the processing system to perform operations comprising the method of claim 13 .

15. A non-transitory computer-readable medium with instructions stored therein, the instructions, when executed by a processing system, cause the processing system to perform operations comprising the method of claim 11 .

16. A data processing apparatus comprising:

a non-transitory computer-readable medium for storing instructions;

a processing system comprising one or more processors having one or more cores, to execute instructions stored on the non-transitory computer-readable medium;

a system runtime, stored on the non-transitory computer-readable medium and executed by the processing system, the system runtime to,

allocate a system global pool in a contiguous range of random access memory,

assign a first block of memory in the system global pool to a first thread of a running process, and

modify a process's machine code to store a local variable of a function of the first thread in the first block of memory, such that the local variable is hidden from a stack frame back-trace.

17. The data processing apparatus of claim 16 ,wherein the system runtime is further to dynamically allocate a second data structure in system memory and modify a process's machine code to store a local variable of a function of a second thread in a second block of memory such that the local variable is hidden from a stack frame back-trace.

18. The data processing apparatus of claim 17 , wherein the first and second block of memory are outside of virtual memory address space of the running process.

19. The data processing apparatus of claim 18 , wherein the system runtime is to allocate the system global pool in a contiguous range of system heap memory.

20. The data processing apparatus of claim 19 , wherein the system runtime, before the process's machine code is modified to store the local variable of the function of the second thread, is further to:

lock the second data structure;

assign the second block of memory to the second thread; and

unlock the second data structure.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Oct 12, 2012
From: MCLACHLAN, JONATHAN G.; LEROUGE, JULIEN; SULLIVAN, NICHOLAS T.
To: APPLE INC.
Reel/Frame 029121/0424 →
Continuity (1)
Related Publication 20140095812A1 · Apr 3, 2014