summaryrefslogtreecommitdiff
path: root/sys/kern/kern_exec.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2014-11-16 12:31:02 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2014-11-16 12:31:02 +0000
commit84110ac1ecd0b90236884f584c62f0aba5630fc2 (patch)
treefad09b733c1e1122314b073b82f6d36a1024e050 /sys/kern/kern_exec.c
parentcbbf1bf46622bbdb478ef4df4e4e027e0b83fc62 (diff)
Replace a plethora of historical protection options with just
PROT_NONE, PROT_READ, PROT_WRITE, and PROT_EXEC from mman.h. PROT_MASK is introduced as the one true way of extracting those bits. Remove UVM_ADV_* wrapper, using the standard names. ok doug guenther kettenis
Diffstat (limited to 'sys/kern/kern_exec.c')
-rw-r--r--sys/kern/kern_exec.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c
index 24ca23c37c6..910f9b9b004 100644
--- a/sys/kern/kern_exec.c
+++ b/sys/kern/kern_exec.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_exec.c,v 1.147 2014/10/18 15:20:32 kettenis Exp $ */
+/* $OpenBSD: kern_exec.c,v 1.148 2014/11/16 12:31:00 deraadt Exp $ */
/* $NetBSD: kern_exec.c,v 1.75 1996/02/09 18:59:28 christos Exp $ */
/*-
@@ -835,8 +835,8 @@ exec_sigcode_map(struct process *pr, struct emul *e)
uao_reference(e->e_sigobject); /* permanent reference */
if ((r = uvm_map(kernel_map, &va, round_page(sz), e->e_sigobject,
- 0, 0, UVM_MAPFLAG(UVM_PROT_RW, UVM_PROT_RW,
- UVM_INH_SHARE, UVM_ADV_RANDOM, 0)))) {
+ 0, 0, UVM_MAPFLAG(PROT_READ | PROT_WRITE, PROT_READ | PROT_WRITE,
+ UVM_INH_SHARE, POSIX_MADV_RANDOM, 0)))) {
uao_detach(e->e_sigobject);
return (ENOMEM);
}
@@ -847,8 +847,8 @@ exec_sigcode_map(struct process *pr, struct emul *e)
pr->ps_sigcode = 0; /* no hint */
uao_reference(e->e_sigobject);
if (uvm_map(&pr->ps_vmspace->vm_map, &pr->ps_sigcode, round_page(sz),
- e->e_sigobject, 0, 0, UVM_MAPFLAG(UVM_PROT_RX, UVM_PROT_RX,
- UVM_INH_SHARE, UVM_ADV_RANDOM, 0))) {
+ e->e_sigobject, 0, 0, UVM_MAPFLAG(PROT_READ | PROT_EXEC,
+ PROT_READ | PROT_EXEC, UVM_INH_SHARE, POSIX_MADV_RANDOM, 0))) {
uao_detach(e->e_sigobject);
return (ENOMEM);
}