summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2018-02-11 04:12:22 +0000
committerderaadt <deraadt@openbsd.org>2018-02-11 04:12:22 +0000
commit8adff5e22e3af505bebef0d446674251f60eed43 (patch)
treedebdbce72e59b91100a73a5a544c99b3da4d7080
parentCan mask MAP_STACK by name rather than number (diff)
downloadwireguard-openbsd-8adff5e22e3af505bebef0d446674251f60eed43.tar.xz
wireguard-openbsd-8adff5e22e3af505bebef0d446674251f60eed43.zip
Start mapping thread stacks with MAP_STACK. mmap() currently ignores
the flag, but some problem identification can begin.
-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);