I wonder why countermeasures against code-injection and control-flow hijacking attacks (e.g. stack-based buffer overflows and heap-based buffer overflows) are mostly implemented in software.
Examples of popular and widely deployed countermeasures are:
- Stack canaries
- Non-executable memory regions
But why exactly are these countermeasures not completely implemented in hardware, or at least supported by hardware? Since nowadays reconfigurable hardware (e.g. FPGA's) is affordable, this approach seems perfectly possible to me.
Or do hardware-based countermeasures exist? And if so, can anyone give me some examples?