[PATCH] Fix stack memory protection on targets where the stack grows upward

John David Anglin dave.anglin@bell.net
Sun Apr 16 17:20:00 GMT 2017


The tst-cputimer1 test fails on hppa.  Using strace to look at the system calls generated by the test,
I observed that there is a mprotect call that passes a non page-aligned addr argument and it fails
with the error EINVAL.

The attached change aligns the old and new guard addresses to page boundaries and fixes the
failing mprotect call.

A version of this patch, hppa/local-stack-grows-up.diff, has been installed in Debian for a long time.
However, the old and new guard values were reversed in the compare.  As a result, the mprotect call
was skipped.  This versions checks that the new_guard value is greater than the old_guard value.

Please install.

Dave
--
John David Anglin	dave.anglin@bell.net


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: allocatestack.d.txt
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20170416/cf09013b/attachment.txt>


More information about the Libc-alpha mailing list