From: Markos Chandras <markos.chand...@imgtec.com>

mprotect() expects the first argument to be aligned to a page boundary.

Signed-off-by: Markos Chandras <markos.chand...@imgtec.com>
---
 libpthread/nptl/allocatestack.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libpthread/nptl/allocatestack.c b/libpthread/nptl/allocatestack.c
index 9399c2a..3f0586d 100644
--- a/libpthread/nptl/allocatestack.c
+++ b/libpthread/nptl/allocatestack.c
@@ -645,7 +645,7 @@ allocate_stack (const struct pthread_attr *attr, struct 
pthread **pdp,
                        prot) != 0)
            goto mprot_error;
 #elif defined _STACK_GROWS_UP
-         if (mprotect ((char *) pd - pd->guardsize,
+         if (mprotect ((char *) (((uintptr_t) pd - pd->guardsize) & 
~pagesize_m1),
                        pd->guardsize - guardsize, prot) != 0)
            goto mprot_error;
 #endif
-- 
1.8.1.2


_______________________________________________
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc

Reply via email to