From da1579dfc831c352b2a9b19d7362ab7dd8d945fb Mon Sep 17 00:00:00 2001 From: Shawn Webb Date: Tue, 20 Jun 2017 14:50:31 -0400 Subject: [PATCH] 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 Sponsored-by: SoldierX --- lib/libthr/thread/thr_init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libthr/thread/thr_init.c b/lib/libthr/thread/thr_init.c index e5393c05f2c..2f62619ce07 100644 --- a/lib/libthr/thread/thr_init.c +++ b/lib/libthr/thread/thr_init.c @@ -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");