IP Library Granted Patent US 9,411,747
Granted Patent B2
US 9,411,747 · App. 14/172,661 · Granted Aug 9, 2016

Dynamic subroutine stack protection

Inventors: Dirk Heisswolf (Munich, DE); Stéphanie Legeleux (Munich, DE); Andreas Ralph Pachl (Neubiberg, DE)
Assignee: Freescale Semiconductor, Inc.
G06F12/14G06F12/1441G06F21/52G06F2212/1052
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,411,747
App. No.
14/172,661
Granted
Aug 9, 2016
Kind
B2
Abstract

A protection unit of a subroutine stack accessible by a CPU controlled by one main software program, for storing and removing stack frame(s), the stack protection unit being coupleable to the stack and the CPU, comprising: a processor coupled to a first and a second address register; wherein, when a first stack frame is stored onto the stack and the execution of the main software program is suspended by the CPU due to the execution of a subroutine; the processing unit is adapted to set one access rule based on the first and second address registers, preventing: the ongoing subroutine, from accessing a hardware-protected region of the stack, comprising at least one stack frame associated with a return address from which the main software program resumes execution after termination of the execution of the subroutine. A processor, a method and a computer program are also claimed.

Claims (59)

1. A stack protection unit for preventing unauthorized access to at least part of a memory stack, the memory stack having memory addresses extending between a top address and a bottom address, the memory stack being accessible by a processor for storing and removing at least one stack frame, the processor controllable by one main software program, the stack protection unit comprising:

a first and a second address register, each adapted to store an address of the stack;

a third and a fourth address register, each adapted to store an address of the stack; and

the processor, wherein the processor is coupled to the first and second address registers,

wherein, when the execution of the main software program is suspended by the processor due to the execution of a first subroutine of the main software program,

the processor is configured to:

set at least one access rule based on at least the first and second address registers, preventing the ongoing subroutine from accessing at least a first hardware-protected region of the memory stack, the first hardware-protected region comprising at least one stack frame associated with a return address from which the main software program resumes execution after termination of the execution of the first subroutine;

store onto the memory stack, a second stack frame comprising content of the second address register;

store in the first address register, a bottom address associated with the second stack frame;

store in the second address register, a top address associated with a third stack frame stored onto the memory stack by the main software program, the third stack frame comprising a return address from which the main software program resumes execution after termination of the execution of the first subroutine;

set a first access rule preventing the first subroutine from accessing the first hardware-protected region of the memory stack, the first hardware-protected region extending between the address of the memory stack stored in the first address register and the address of the memory stack stored in the second address register; and

wherein, when the execution of the first subroutine is suspended due to execution of at least one nested subroutine, the processor is further configured to store in the first address register a bottom address of the memory stack and to, until the nested subroutines have terminated execution, recursively:

store onto the memory stack, a fourth stack frame comprising content of the second address register;

store in the fourth address register, content of the second address register;

store in the third address register, a bottom address associated with the fourth stack frame;

store in the second address register, a top address associated with a fifth stack frame stored onto the memory stack by the first subroutine or a nested subroutine, the fifth stack frame comprising a return address from which the first subroutine or a nested subroutine resumes execution after termination of the execution of an ongoing subroutine; and

set a second access rule preventing the ongoing subroutine from accessing the first hardware-protected region of the memory stack, the first hardware-protected region extending between the address of the memory stack stored in the second address register and the address of the memory stack stored in the third address register, and a second hardware-protected region of the memory stack, the second hardware-protected region extending between the address of the memory stack stored in the first address register and the address of the memory stack stored in the fourth address register.

2. The stack protection unit of claim 1 , wherein, when executing the main software program:

the processor is configured to store in:

the first address register, the bottom address of the memory stack;

the second address register, the bottom address of the memory stack or a null address.

3. The stack protection unit of claim 1 , wherein the first hardware-protected region of the memory stack extends between the address of the memory stack stored in the second address register and a predetermined higher address relative to the address of the memory stack stored in the second address register.

4. The stack protection unit of claim 1 , wherein, when the execution of the first subroutine is terminated:

the processor is further adapted to store in the second address register content of the second stack frame.

5. The stack protection unit of claim 1 , wherein, when the execution of the ongoing subroutine is terminated:

the processor is further adapted to:

store in the second address register, content of a latest stored stack frame selected between the third stack frame and the fourth stack frame;

store in the third address register, a bottom address associated with a latest stored stack frame selected between the second stack frame and the fourth stack frame;

store in the fourth address register, one address selected between:

a top address associated with a latest stored stack frame selected between the third stack frame and the fifth stack frame; and

the bottom address of the memory stack.

6. A method of preventing unauthorized access to at least part of a memory stack, the memory stack having memory addresses extending between a top address and a bottom address, the memory stack being accessible by a processor for storing and removing at least one stack frame, the method comprising:

providing a first, a second, a third and a fourth address register, each adapted to store a respective address of the memory stack, wherein the processor is coupled to the first and second registers;

when the execution of the main software program is suspended by the CPU due to the execution of a first subroutine of the main software program,

causing the processing unit processor to:

set at least one access rule based on at least the first and second address registers, preventing

the first subroutine from accessing at least a first hardware-protected region of the memory stack, the first hardware-protected region comprising at least one stack frame associated with a return address from which the main software program resumes execution after termination of the execution of the first subroutine;

store onto the memory stack, a second stack frame comprising content of the second address register;

store in the first address register, a bottom address associated with the second stack frame;

store in the second address register, a top address associated with a third stack frame stored onto the memory stack by the main software program, the third stack frame comprising a return address from which the main software program resumes execution after termination of the execution of the first subroutine; and,

set at least one access rule preventing the first subroutine from accessing the first hardware-protected region of the memory stack, the first hardware-protected region extending between an address of the memory stack stored in the first address register and an address of the memory stack stored in the second address register; and

when execution of the first subroutine is suspended due to execution of at least one nested subroutine, causing the processor to further store in the first address register the bottom address of the memory stack and to, until the nested subroutines have terminated execution, recursively:

store onto the memory stack, a fourth stack frame comprising content of the second address register;

store in the fourth address register, content of the second address register;

store in the third address register, a bottom address associated with the fourth stack frame;

store in the second address register, a top address associated with a fifth stack frame stored onto the memory stack by the first subroutine or a nested subroutine, the fifth stack frame comprising a return address from which the first subroutine or a nested subroutine resumes execution after termination of the execution of an ongoing subroutine; and

set at least one access rule preventing the ongoing subroutine from accessing the first hardware-protected region of the memory stack, the first hardware-protected region extending between an address of the memory stack stored in the second address register and an address of the memory stack stored in the third address register, and a second hardware-protected region of the memory stack, the second hardware-protected region extending between an address of the memory stack stored in the first address register and an address of the memory stack stored in the fourth address register.

7. The method of claim 6 , further comprising during the execution of the main software program:

storing the bottom address of the stack in the first address register; and

storing the bottom address of the stack or a null address in the second address register.

8. The method of claim 6 wherein the first hardware-protected region of the memory stack extends between an address of the memory stack stored in the second address register and a predetermined higher address relative to the address of the memory stack stored in the second address register.

9. The method of claim 6 , further comprising, when the execution of the first subroutine is terminated, storing content of the second stack frame

in the second address register.

10. The method of claim 6 , further comprising, when the execution of the ongoing subroutine is terminated:

storing in the second address register, a bottom address associated with a latest stored stack frame selected between the third stack frame and the fourth stack frame;

storing in the third address register, content of the latest stored stack frame selected between the second stack frame and the fourth stack frame;

storing in the fourth address register, one address selected between:

a top address associated with the latest stored stack frame selected between the third stack frame and the fifth stack frame; and

the bottom address of the memory stack.

Assignments (25)
CORRECTIVE ASSIGNMENT TO CORRECT THE REMOVE APPLICATION 11759915 AND REPLACE IT WITH APPLICATION 11759935 PREVIOUSLY RECORDED ON REEL 040925 FRAME 0001. ASSIGNOR(S) HEREBY CONFIRMS THE RELEASE OF SECURITY INTEREST. Recorded Feb 17, 2020
From: MORGAN STANLEY SENIOR FUNDING, INC.
To: NXP, B.V. F/K/A FREESCALE SEMICONDUCTOR, INC.
Reel/Frame 052917/0001 →
CORRECTIVE ASSIGNMENT TO CORRECT THE REMOVE APPLICATION 11759915 AND REPLACE IT WITH APPLICATION 11759935 PREVIOUSLY RECORDED ON REEL 040928 FRAME 0001. ASSIGNOR(S) HEREBY CONFIRMS THE RELEASE OF SECURITY INTEREST. Recorded Jan 17, 2020
From: MORGAN STANLEY SENIOR FUNDING, INC.
To: NXP B.V.
Reel/Frame 052915/0001 →
CORRECTIVE ASSIGNMENT TO CORRECT THE REMOVE APPLICATION 12298143 PREVIOUSLY RECORDED ON REEL 039361 FRAME 0212. ASSIGNOR(S) HEREBY CONFIRMS THE SECURITY AGREEMENT SUPPLEMENT. Recorded Oct 22, 2019
From: NXP B.V.
To: MORGAN STANLEY SENIOR FUNDING, INC.
Reel/Frame 051029/0387 →
CORRECTIVE ASSIGNMENT TO CORRECT THE REMOVE APPLICATION 12298143 PREVIOUSLY RECORDED ON REEL 042762 FRAME 0145. ASSIGNOR(S) HEREBY CONFIRMS THE SECURITY AGREEMENT SUPPLEMENT. Recorded Oct 22, 2019
From: NXP B.V.
To: MORGAN STANLEY SENIOR FUNDING, INC.
Reel/Frame 051145/0184 →
CORRECTIVE ASSIGNMENT TO CORRECT THE REMOVE APPLICATION 12298143 PREVIOUSLY RECORDED ON REEL 038017 FRAME 0058. ASSIGNOR(S) HEREBY CONFIRMS THE SECURITY AGREEMENT SUPPLEMENT. Recorded Oct 22, 2019
From: NXP B.V.
To: MORGAN STANLEY SENIOR FUNDING, INC.
Reel/Frame 051030/0001 →
CORRECTIVE ASSIGNMENT TO CORRECT THE REMOVE APPLICATION 12298143 PREVIOUSLY RECORDED ON REEL 042985 FRAME 0001. ASSIGNOR(S) HEREBY CONFIRMS THE SECURITY AGREEMENT SUPPLEMENT. Recorded Oct 22, 2019
From: NXP B.V.
To: MORGAN STANLEY SENIOR FUNDING, INC.
Reel/Frame 051029/0001 →
RELEASE OF SECURITY INTEREST Recorded Sep 10, 2019
From: MORGAN STANLEY SENIOR FUNDING, INC.
To: NXP B.V.
Reel/Frame 050744/0097 →
RELEASE OF SECURITY INTEREST Recorded Sep 10, 2019
From: MORGAN STANLEY SENIOR FUNDING, INC.
To: NXP B.V.
Reel/Frame 050745/0001 →
CORRECTIVE ASSIGNMENT TO CORRECT THE REMOVE APPLICATION 12681366 PREVIOUSLY RECORDED ON REEL 038017 FRAME 0058. ASSIGNOR(S) HEREBY CONFIRMS THE SECURITY AGREEMENT SUPPLEMENT. Recorded May 9, 2017
From: NXP B.V.
To: MORGAN STANLEY SENIOR FUNDING, INC.
Reel/Frame 042985/0001 →
CORRECTIVE ASSIGNMENT TO CORRECT THE REMOVE APPLICATION 12681366 PREVIOUSLY RECORDED ON REEL 039361 FRAME 0212. ASSIGNOR(S) HEREBY CONFIRMS THE SECURITY AGREEMENT SUPPLEMENT. Recorded May 9, 2017
From: NXP B.V.
To: MORGAN STANLEY SENIOR FUNDING, INC.
Reel/Frame 042762/0145 →
MERGER Recorded Jan 3, 2017
From: FREESCALE SEMICONDUCTOR, INC.
To: NXP USA, INC.
Reel/Frame 041144/0363 →
RELEASE OF SECURITY INTEREST Recorded Nov 7, 2016
From: MORGAN STANLEY SENIOR FUNDING, INC.
To: NXP B.V.
Reel/Frame 040928/0001 →
RELEASE OF SECURITY INTEREST Recorded Sep 21, 2016
From: MORGAN STANLEY SENIOR FUNDING, INC.
To: NXP, B.V., F/K/A FREESCALE SEMICONDUCTOR, INC.
Reel/Frame 040925/0001 →
CORRECTIVE ASSIGNMENT TO CORRECT THE REMOVE APPLICATION 12092129 PREVIOUSLY RECORDED ON REEL 038017 FRAME 0058. ASSIGNOR(S) HEREBY CONFIRMS THE SECURITY AGREEMENT SUPPLEMENT. Recorded Jul 14, 2016
From: NXP B.V.
To: MORGAN STANLEY SENIOR FUNDING, INC.
Reel/Frame 039361/0212 →
SUPPLEMENT TO THE SECURITY AGREEMENT Recorded Jun 16, 2016
From: FREESCALE SEMICONDUCTOR, INC.
To: MORGAN STANLEY SENIOR FUNDING, INC.
Reel/Frame 039138/0001 →
CORRECTIVE ASSIGNMENT TO CORRECT THE APPLICATION NUMBERS PREVIOUSLY RECORDED AT REEL: 037458 FRAME: 0438. ASSIGNOR(S) HEREBY CONFIRMS THE ASSIGNMENT AND ASSUMPTION OF SECURITY INTEREST IN PATENTS. Recorded May 12, 2016
From: CITIBANK, NA
To: MORGAN STANLEY SENIOR FUNDING, INC.
Reel/Frame 038665/0136 →
CORRECTIVE ASSIGNMENT TO CORRECT THE INCORRECT APPLICATION NUMBERS 12222918, 14185362, 14147598, 14185868 & 14196276 PREVIOUSLY RECORDED AT REEL: 037458 FRAME: 0479. ASSIGNOR(S) HEREBY CONFIRMS THE ASSIGNMENT AND ASSUMPTION OF SECURITY INTEREST IN PATENTS. Recorded May 12, 2016
From: CITIBANK, NA
To: MORGAN STANLEY SENIOR FUNDING, INC.
Reel/Frame 038665/0498 →
SECURITY AGREEMENT SUPPLEMENT Recorded Mar 7, 2016
From: NXP B.V.
To: MORGAN STANLEY SENIOR FUNDING, INC.
Reel/Frame 038017/0058 →
ASSIGNMENT AND ASSUMPTION OF SECURITY INTEREST IN PATENTS Recorded Jan 7, 2016
From: CITIBANK, N.A.
To: MORGAN STANLEY SENIOR FUNDING, INC.
Reel/Frame 037458/0438 →
ASSIGNMENT AND ASSUMPTION OF SECURITY INTEREST IN PATENTS Recorded Jan 7, 2016
From: CITIBANK, N.A.
To: MORGAN STANLEY SENIOR FUNDING, INC.
Reel/Frame 037458/0479 →
PATENT RELEASE Recorded Dec 21, 2015
From: CITIBANK, N.A., AS COLLATERAL AGENT
To: FREESCALE SEMICONDUCTOR, INC.
Reel/Frame 037357/0763 →
SUPPLEMENT TO SECURITY AGREEMENT Recorded May 7, 2014
From: FREESCALE SEMICONDUCTOR, INC.
To: CITIBANK, N.A., AS NOTES COLLATERAL AGENT
Reel/Frame 032845/0442 →
SUPPLEMENT TO SECURITY AGREEMENT Recorded May 7, 2014
From: FREESCALE SEMICONDUCTOR, INC.
To: CITIBANK, N.A., AS NOTES COLLATERAL AGENT
Reel/Frame 032845/0522 →
SUPPLEMENT TO SECURITY AGREEMENT Recorded May 7, 2014
From: FREESCALE SEMICONDUCTOR, INC.
To: CITIBANK, N.A., AS COLLATERAL AGENT
Reel/Frame 032845/0497 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Feb 6, 2014
From: HEISSWOLF, DIRK; LEGELEUX, STEPHANIE; PACHL, ANDREAS RALPH
To: FREESCALE SEMICONDUCTOR, INC.
Reel/Frame 032153/0296 →
Continuity (1)
Related Publication 20150220453A1 · Aug 6, 2015