|
|
|
|
|
by jnwatson
2165 days ago
|
|
I'll add on since this is the most informative post so far (and I've written a static binary re-writer to add shadow stack protection to an existing binary). A shadow stack is a limited subset of the call stack that only stores return addresses. In normal operation, Every time your compiled program makes a function call, it stores the return address on the main call stack (modulo certain compiler optimizations) so that when the called function returns, your program can resume executing directly after the point at which it called the function. With a shadow stack, when a function is called, the return address is copied to a separate "shadow" stack as well as the call stack. When the called function returns, the return address on the two stacks are compared and the program fails if they are different. In new Intel microprocessors, the shadow stack is implemented in hardware. The numerous corner cases require software support that the article describes. |
|