This reverts commit b7b19ffccfb139fc731dca94655b3531a50c61ca. The
per-thread stack randomization needs more thought. It's likely that this
implementation is being too aggressive.
Signed-off-by: Shawn Webb <shawn.webb@hardenedbsd.org>
(cherry picked from commit 5d741f44acf944a48dd14390fec663b42f962e96)
(cherry picked from commit 233c617c4908a4249a70af89dcbea31575f0dc87)
The per-thread stack implementation in libthr supplies a hint to
mmap(2). ASLR will get applied to it, it could be hardened still.
Provide additional hardening by randomizing the size of the per-thread
stack guard provided by libthr. This will effectively randomize the top
of the per-thread stack at a page-level granularity. Additional entropy
could be provided by introducing a random-sized gap, thus getting better
than page-level granularity.
Signed-off-by: Shawn Webb <shawn.webb@hardenedbsd.org>
Sponsored-by: SoldierX
libthr inserts its own stack guard. Harden it for the same reasons as
commit 13971cb990b78e679ab338b4e8baf24f3e0d8730.
Signed-off-by: Shawn Webb <shawn.webb@hardenedbsd.org>
Sponsored-by: SoldierX