3 ms·
A shadow stack is a separate stack that is only maintained by making function calls and returning according to what the CPU actually did. In theory you can't tr
by fwsgonzo 3y ago
A shadow stack is a separate stack that is only maintained by making function calls and returning according to what the CPU actually did. In theory you can't trample the stack, so it's both a security feature and a way to avoid weird GDB sessions.
I'm not sure but I think shadow stack makes assumptions about how you use the ISA. For example, it's a completely legitimate program to just execute forward 10 million instructions, and use the stack pointer for other things. Or use another register. RISC-V made JAL take any register, but then no compiler that I've ever seen will use anything but RA. But it's also pretty harmless! What isn't an assumption is how Linux uses the stack, so we can at least say that it makes Linux more reliable.
Fun fact: Golang doesn't use GP as a global pointer to data. It doesn't even use the register, maybe to be compatible with C?