From 8adff5e22e3af505bebef0d446674251f60eed43 Mon Sep 17 00:00:00 2001 From: deraadt Date: Sun, 11 Feb 2018 04:12:22 +0000 Subject: [PATCH] Start mapping thread stacks with MAP_STACK. mmap() currently ignores the flag, but some problem identification can begin. --- lib/librthread/rthread_stack.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/librthread/rthread_stack.c b/lib/librthread/rthread_stack.c index 73c13e8478d..37d2eeadc05 100644 --- a/lib/librthread/rthread_stack.c +++ b/lib/librthread/rthread_stack.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rthread_stack.c,v 1.18 2018/02/10 22:59:02 deraadt Exp $ */ +/* $OpenBSD: rthread_stack.c,v 1.19 2018/02/11 04:12:22 deraadt Exp $ */ /* PUBLIC DOMAIN: No Rights Reserved. Marco S Hyman */ @@ -92,7 +92,7 @@ _rthread_alloc_stack(pthread_t thread) /* actually allocate the real stack */ base = mmap(NULL, size, PROT_READ | PROT_WRITE, - MAP_PRIVATE | MAP_ANON, -1, 0); + MAP_PRIVATE | MAP_ANON | MAP_STACK, -1, 0); if (base == MAP_FAILED) { free(stack); return (NULL); -- 2.20.1