summaryrefslogtreecommitdiffstats
path: root/sys/vm/vm_map.c
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2012-06-10 11:31:50 +0000
committerkib <kib@FreeBSD.org>2012-06-10 11:31:50 +0000
commita280ada6e7368858fc9816bc37512adaecfd57b1 (patch)
tree63c8c418766e713c7be2de40301bae196e0a4350 /sys/vm/vm_map.c
parent6450bdd899dc9e0889a213594c315c02d32661a9 (diff)
downloadFreeBSD-src-a280ada6e7368858fc9816bc37512adaecfd57b1.zip
FreeBSD-src-a280ada6e7368858fc9816bc37512adaecfd57b1.tar.gz
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
Diffstat (limited to 'sys/vm/vm_map.c')
-rw-r--r--sys/vm/vm_map.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c
index b74cec1..f95fd82 100644
--- a/sys/vm/vm_map.c
+++ b/sys/vm/vm_map.c
@@ -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) {
OpenPOWER on IntegriCloud