diff options
author | Markos Chandras <markos.chandras@imgtec.com> | 2013-02-12 13:44:25 +0000 |
---|---|---|
committer | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2013-02-27 22:16:20 +0100 |
commit | 60c1fe7f456b1cd17c71ea6a9c4a234d9f147b7b (patch) | |
tree | fb5f6f1cc294ab01789d82f5fc9eeb42a2acf32e | |
parent | 49d3f93362c7eb359f82a4d9204a0519f73f3820 (diff) |
nptl/allocatestack.c: Fix stack mprotect alignment for STACK_GROWS_UP
mprotect() expects the first argument to be aligned to a page boundary.
Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
-rw-r--r-- | libpthread/nptl/allocatestack.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libpthread/nptl/allocatestack.c b/libpthread/nptl/allocatestack.c index 9399c2a63..3f0586d28 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 |