
Understanding Hardware-Enforced Stack Protection - ingve
https://techcommunity.microsoft.com/t5/windows-kernel-internals/understanding-hardware-enforced-stack-protection/ba-p/1247815
======
Taniwha
I was thinking about this the other day, wondering why modern RISC machines
(like RISC-V). that don't have call/return instructions that hard code stack
direction, simply have coding models that grow their stacks upwards - this
would avoid most of these sorts of problems

~~~
nayuki
The classical reason why stacks grow downward is because heaps grow upward.
This arrangement maximizes the usefulness of the virtual address space in a
single-threaded process.

~~~
Taniwha
well stacks typically grew downwards even before there were heaps (but not
always - Burroughs large systems for example)

Heaps of course can grow downwards

With modern 64-bit address spaces actual running out of space is not an issue
(especially since we're dynamically moving around code, heaps and stacks for
security reasons anyway)

