4 ms·
Curiously, this is an idea who's time has come again. Keeping the return address space (call stack) separate from the display containing addressable data, could
by JoeAltmaier 6y ago
Curiously, this is an idea who's time has come again. Keeping the return address space (call stack) separate from the display containing addressable data, could avoid some nasty security issues that plague most architectures.
- Sniffnoy 6y agoSeems to me the issue of overflows corrupting return addresses could be avoided if the stack just grew upwards instead of downwards. Wouldn't prevent data corruption from overflows, but then neither would what you're suggesting...
- JoeAltmaier 6y agoHow so? Indexing off a display structure negatively works as well as positively...
- Animats 6y agoForth CPUs worked like that. But it would break setjump/longjmp, exception unwinding, debuggers, "green threads", goroutines, "async", coroutines - everything that messes with control flow from within the process. All that stuff assumes return points are in the same address space as the other data data.
- JoeAltmaier 6y agoGood analysis! Some of that is kernel prerogative. Still could be coded. Just avoid user code manipulating stacks. The introduction of instructions to support those features is conceivable. Still while avoiding "unrestricted addressing of the entire call stack at will".
- jcranmer 6y agoI don't think it actually avoids those nasty security issues--just makes attacking them somewhat harder. Userspace still needs to read and write the call stack to support features such as debugging and unwind support, not to mention green threads, so you can probably still leverage existing libraries in malicious ways (à la return-oriented programming) to do the stack manipulation necessary to get you to return-oriented programming attacks.
- JoeAltmaier 6y agoThe call stack need only be inaccessible to normal data operations. If it is solely user-addressable with call and return instructions, the vulnerability is gone. That's kind of the whole point - call/return can be vastly more secure than 'part of a data space' as it is now. Benefits would accrue. And challenges.
- jcranmer 6y agoHow would you implement something like _Unwind_Resume, which requires returning to a different return address that's based on but not identical to the one on the stack?
- JoeAltmaier 6y agoNot an expert. Implemented as a hidden return value/switch at the appropriate point? Some features may be inherently dangerous and not supportable on a secure processor.