×

Method of protecting a computer stack

  • US 7,581,089 B1
  • Filed: 04/18/2007
  • Issued: 08/25/2009
  • Est. Priority Date: 04/20/2006
  • Status: Active Grant
First Claim
Patent Images

1. A method of protecting a value on a computer stack, comprising the steps of:

  • a) creating a first computer stack on a computer, the first computer stack having a first stack pointer;

    b) creating a second computer stack on a computer, the second computer stack having a second stack pointer which points to shadow frames, wherein the second stack stores a return address located on the first stack upon a call to a subroutine in a first shadow element, the address of the return address stored on the first stack upon a call to a subroutine in a second shadow element, and a user-definable variable defining the status of the return address stored on the second computer stack in a third shadow element;

    c) storing a return address upon a call to a subroutine on the first computer stack;

    d) storing on the second stack the return address from step (c), the address of the return address stored in step (c), and the user-definable status variable to indicate the current shadow frame contains a return address;

    e) advancing the first stack pointer to the next available frame on the first computer stack and advancing the second stack pointer to the next available shadow frame on the second computer stack;

    f) jumping to the subroutine;

    g) executing the subroutine;

    h) fetching the return address from the second computer stack and the return address from the first computer stack, wherein the return address from the second computer stack is the first return address stored on the second computer stack below the current position of the second stack pointer;

    i) comparing the return address from the second computer stack to the return address from the first computer stack;

    j) if the return address from the second computer stack is the same as the return address from the first computer stack, proceed to step (c), otherwise proceeding to step (o);

    k) decrementing the stack pointer on the first computer stack;

    l) synchronizing the second computer stack'"'"'s stack pointer with the first computer stack'"'"'s stack pointer by decrementing the second stack pointer on the second computer stack to at least one previous shadow frame;

    m) loading the instruction pointer with the return address;

    n) if additional subroutines exist on the first computer stack, returning to step (c), otherwise stopping;

    o) searching the second computer stack, below the position of the current second stack pointer and above the position of the current stack pointer, for a return address that matches the return address fetched from the first computer stack;

    p) if a matching return address is found in step (o), and if user-definable status variable indicates the shadow frame containing the return address was stored on the second computer stack as a return address;

    q) if the result of step (p) indicates a matching return address, proceeding to step (k), otherwise stopping; and

    r) write-disabling the second computer stack by application software, the second computer stack write-enabled by hardware code when storing on the second stack the return address from step (c).

View all claims
  • 1 Assignment
Timeline View
Assignment View
    ×
    ×