HBSD: Harden per-thread stack guard

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
(cherry picked from commit da1579dfc8)
This commit is contained in:
Shawn Webb 2017-06-20 14:50:31 -04:00 committed by Franco Fichtner
parent 88effd287e
commit fd30a6ef8a

View file

@ -477,7 +477,7 @@ init_private(void)
sysctlbyname("kern.smp.cpus", &_thr_is_smp, &len, NULL, 0);
_thr_is_smp = (_thr_is_smp > 1);
_thr_page_size = getpagesize();
_thr_guard_default = _thr_page_size;
_thr_guard_default = (2 * 1024 * 1024);
_pthread_attr_default.guardsize_attr = _thr_guard_default;
_pthread_attr_default.stacksize_attr = _thr_stack_default;
env = getenv("LIBPTHREAD_SPINLOOPS");