On 7/4/2011 1:49 PM, Carlos O'Donell wrote:
On Mon, Jul 4, 2011 at 12:58 PM, John David Anglin<dave.anglin@xxxxxxxx> wrote:
Why would this mprotect fail with -EINVAL? It's not page aligned?
You can see the earlier mmap/mprotect from thread one's stack looks
page aligned.
I believe that the stack value needs to be aligned. See comment in
arch_get_unmapped_area. Not sure if this will fix mprotect.
What needs to be aligned, the stack value or the addr in a call to mprotect?
Actually, it's not the stack address but the address used in the malloc
call to allocate the
thread's stack that needs alignment. I believe 64 bytes are used by the
parent. In current
thread setup. So, it looks like child_stack value is ok.
The Linux man page says the mprotect addr must be a valid pointer or a
multiple of PAGESIZE.
It's not clear what the mprotect call is trying to protect but it is
definitely not page aligned.
I submitted a patch to return an error if but there was no comment.
Reference?
http://www.spinics.net/lists/linux-parisc/msg03352.html
Dave
--
To unsubscribe from this list: send the line "unsubscribe linux-parisc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html