Run-time value of a gap page that gets inserted at the top of a new stack frame in Redox-OS?
Created by: redox-questions
OpenBSD has a kern.stackgap_random sysctl:
https://man.openbsd.org/sysctl.2
KERN_STACKGAPRANDOM (kern.stackgap_random) Sets the range of the random value added to the stack pointer on each program execution. The random value is added to make buffer overflow exploitation slightly harder. The bigger the number, the harder it is to brute force this added protection, but it also means bigger waste of memory.
Basically, you're adjusting the run-time value of a gap page that gets inserted at the top of a new stack frame, so that when an attacker is analyzing a binary and attempting to write an exploit, there is an unknown-at-compile-time number of bytes which have to be included when building the exploit and attempting to over-write the return address to the previous stack frame. It's just one of a series of mitigations against buffer overflows
Will Redox OS use it?
Thanks.