Date: Sun, 10 Jun 2012 11:31:51 +0000 (UTC) From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r236848 - head/sys/vm Message-ID: <201206101131.q5ABVpwo094356@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kib Date: Sun Jun 10 11:31:50 2012 New Revision: 236848 URL: http://svn.freebsd.org/changeset/base/236848 Log: Use the previous stack entry protection and max protection to correctly propagate the stack execution permissions when stack is grown down. First, curproc->p_sysent->sv_stackprot specifies maximum allowed stack protection for current ABI, so the new stack entry was typically marked executable always. Second, for non-main stack MAP_STACK mapping, the PROT_ flags should be used which were specified at the mmap(2) call time, and not sv_stackprot. MFC after: 1 week Modified: head/sys/vm/vm_map.c Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Sun Jun 10 11:17:14 2012 (r236847) +++ head/sys/vm/vm_map.c Sun Jun 10 11:31:50 2012 (r236848) @@ -3528,7 +3528,7 @@ Retry: } rv = vm_map_insert(map, NULL, 0, addr, stack_entry->start, - p->p_sysent->sv_stackprot, VM_PROT_ALL, 0); + next_entry->protection, next_entry->max_protection, 0); /* Adjust the available stack space by the amount we grew. */ if (rv == KERN_SUCCESS) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201206101131.q5ABVpwo094356>