3 ms·
Shouldn't there be two stacks? One to contain stuff like return addresses, and the other to contain data? And the stack containing addresses in a separate addre
by amelius 6y ago
Shouldn't there be two stacks? One to contain stuff like return addresses, and the other to contain data? And the stack containing addresses in a separate address space that can only be accessed through stack manipulation/return instructions.
- moonchild 6y agoThis has been suggested, including by the proposed mill and forwardcom architectures. It's also the programming model used by stack-based languages such as forth. Another nice side effect aside from security is that it simplifies the return predictor.
- kccqzy 6y agoThat's known as a shadow stack. Some newer Intel processors even have hardware support for it.
- deleted 6y ago[deleted]
- amelius 6y agoInteresting: https://en.wikipedia.org/wiki/Shadow_stack https://en.wikipedia.org/wiki/Shadow_stack But it seems a shadow stack is a slightly different concept which requires less changes in software.
- sesuximo 6y ago1. Seems like you’d have extra cache contention? 2. How would coroutines/threads handle this? Switch two stack pointers?