summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2018-02-11 04:12:23 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2018-02-11 04:12:23 +0000
commit41dab8420d697dce3547e287b66f5d38be446541 (patch)
treec5fa9f323f0c29543606416e108728d31232bfe0 /lib
parent52bd68882fddae6c33822fefc3c6aa8a12c72a13 (diff)
Start mapping thread stacks with MAP_STACK. mmap() currently ignores
the flag, but some problem identification can begin.
Diffstat (limited to 'lib')
-rw-r--r--lib/librthread/rthread_stack.c4
1 files 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 <marc@snafu.org> */
@@ -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);