IP Library Granted Patent US 9,037,872
Granted Patent B2
US 9,037,872 · App. 13/717,315 · Granted May 19, 2015

Hardware based return pointer encryption

Inventor: David A. Kaplan (Austin, TX)
Assignee: Advanced Micro Devices, Inc.
G06F21/54
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,037,872
App. No.
13/717,315
Granted
May 19, 2015
Kind
B2
Abstract

A processor, a method and a computer-readable storage medium for encrypting a return address are provided. The processor comprises hardware logic configured to encrypt an instruction pointer and push the encrypted instruction pointer onto a stack. The logic is further configured to retrieve the encrypted instruction pointer from the stack, decrypt the instruction pointer and redirect execution to the decrypted instruction pointer.

Claims (65)

1. A processor comprising:

hardware logic configured to:

receive a machine code call instruction configured to cause the processor to call a subroutine by storing a start address of the subroutine into an instruction pointer and a return address onto a call stack;

in response to receiving the machine code call instruction:

encrypt a return address of the subroutine, the return address being the value of the instruction pointer prior to storing the start address, and

store the encrypted return address in the call stack;

retrieve the encrypted return address from the call stack;

decrypt the encrypted return address; and

redirect execution to the return address.

2. The processor of claim 1 , wherein the logic uses a key stored in a register to perform the encryption and decryption.

3. The processor of claim 2 , wherein the register is accessible to privileged code.

4. The processor of claim 2 , wherein the key comprises at least part of a stack pointer.

5. The processor of claim 1 , wherein the logic is configured to use one of a plurality of encryption algorithms.

6. The processor of claim 1 , wherein the logic is configured to permit disabling of the encryption and decryption.

7. A processor comprising:

hardware logic configured to:

receive a machine code call instruction configure to cause the processor to call a subroutine by storing a start address of the subroutine into an instruction pointer and a return address onto a call stack;

in response to receiving the machine code call instruction:

encrypt a return address of the subroutine, the return address being the value of the instruction pointer prior to storing the start address, and

store the encrypted return address in the call stack, and

in response to a machine code re-encrypt instruction:

load the encrypted return address from the call stack,

decrypt the encrypted return address with a first key,

re-encrypt the return address with a second key, and

store the re-encrypted return address in the call stack.

8. A method comprising:

receiving, using circuitry within a processor, a machine code call instruction that causes the processor to call a subroutine by storing a start address of the subroutine into an instruction pointer and a return address onto a call stack;

encrypting, using the circuitry in response to the machine code call instruction, a return address of the subroutine, the return address being the value of the instruction pointer prior to storing the start address;

storing, using the circuitry, the encrypted return address in the stack;

retrieving the encrypted return address from the call stack;

decrypting the encrypted return address; and

redirecting execution to the return address.

9. The method of claim 8 , wherein the method further comprises using a key stored in a register to perform the encryption and decryption.

10. The method of claim 9 , wherein the register is accessible to privileged code.

11. The method of claim 9 , wherein the method further comprises using at least part of a stack pointer as the key.

12. The method of claim 8 , wherein the method further comprises using one of a plurality of encryption algorithms.

13. The method of claim 8 , wherein the method further comprises disabling the encryption and decryption.

14. A method comprising:

receiving, using circuitry within a processor, a machine code call instruction that causes the processor to call a subroutine by storing a start address of the subroutine into an instruction pointer and a return address onto a call stack;

encrypting, using the circuitry, in response to the machine code call instruction, a return address of the subroutine, the return address being the value of the instruction pointer prior to storing the start address;

storing, using the circuitry, the encrypted return address in the call stack;

reading, using the circuitry, in response to a machine code re-encrypt instruction, the encrypted return address from the call stack;

decrypting, using the circuitry, the encrypted return address with a first key;

re-encrypting, using the circuitry, the return address with a second key; and

storing, using the circuitry, the re-encrypted return address in the call stack.

15. A computer-readable storage device having instructions stored thereon, execution of which by a processor cause the processor to perform operations, the operations comprising:

receiving a machine code call instruction that causes the processor to call a subroutine by storing a start address of the subroutine into an instruction pointer and a return address onto a call stack;

encrypting in response to the machine code call instruction, a return address of the subroutine, the return address being the value of the instruction pointer prior to storing the start address;

storing the encrypted return address in the stack;

retrieving the encrypted return address from the call stack;

decrypting the encrypted return address; and

redirecting execution to the return address.

16. The computer-readable storage device of claim 15 , further comprising using a key stored in a register to perform the encryption and decryption.

17. The computer-readable storage device of claim 16 , wherein the register is accessible to privileged code.

18. The computer-readable storage device of claim 15 , further comprising using at least part of a stack pointer as the key.

19. The computer-readable storage device of claim 15 , further comprising using one of a plurality of encryption algorithms.

20. The computer-readable storage device of claim 15 , further comprising disabling the encryption and decryption.

21. A computer-readable storage device having instructions stored thereon, execution of which by a processor cause the processor to perform operations comprising:

receiving a machine code call instruction that causes the processor to call a subroutine by storing a start address of the subroutine into an instruction pointer and a return address onto a call stack;

encrypting, in response to the machine code call instruction, a return address of the subroutine, the return address being the value of the instruction pointer prior to storing the start address;

store the encrypted return address in the call stack;

reading, in response to a machine code re-encrypt instruction, the encrypted return address from the call stack;

decrypting the encrypted return address with a first key;

re-encrypting the return address with a second key; and

storing the re-encrypted return address in the call stack.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Dec 18, 2012
From: KAPLAN, DAVID A.
To: ADVANCED MICRO DEVICES, INC.
Reel/Frame 029494/0288 →
Continuity (1)
Related Publication 20140173293A1 · Jun 19, 2014