logoalt Hacker News

Joker_vDtoday at 10:49 AM1 replyview on HN

> No one should ever need more than 64kBs for a stack anyways.

Well, if people would stop storing anything except than return addresses on the stack, yeah, probably even 32 KiB of stack would be enough for anyone. It'd also single-handedly stop all kinds of stack-smashing attacks, too: can't overwrite a return address on the stack if nothing stores data on the stack except the CALL/RET instructions.

Unfortunately, the current zeitgeist is still to have "writeable stacks" which are only moderately less horrible for the security than "executable stacks".


Replies

rramadasstoday at 12:50 PM

You can probably do this by maintaining two parallel stacks, changes to prologue/epilogue code and runtime startup files.