From 97374d38583028b33074c69caf296d94cb1b9d5b Mon Sep 17 00:00:00 2001 From: Paul Brook Date: Wed, 16 Jun 2010 13:03:51 +0100 Subject: Usermode exec-stack fix When loading a shared library that requires an executable stack, glibc uses the mprotext PROT_GROWSDOWN flag to achieve this. We don't support PROT_GROWSDOWN. Add a special case to handle changing the stack permissions in this way. Signed-off-by: Paul Brook --- linux-user/elfload.c | 1 + 1 file changed, 1 insertion(+) (limited to 'linux-user/elfload.c') diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 2d920f2..accb44d 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -1018,6 +1018,7 @@ static abi_ulong setup_arg_pages(abi_ulong p, struct linux_binprm *bprm, /* we reserve one extra page at the top of the stack as guard */ target_mprotect(error + size, qemu_host_page_size, PROT_NONE); + info->stack_limit = error; stack_base = error + size - MAX_ARG_PAGES*TARGET_PAGE_SIZE; p += stack_base; -- cgit v1.1