diff options
author | Philip Guenther <guenther@cvs.openbsd.org> | 2014-05-29 05:05:35 +0000 |
---|---|---|
committer | Philip Guenther <guenther@cvs.openbsd.org> | 2014-05-29 05:05:35 +0000 |
commit | 2f056a5d5c8adfc44bbd19d4aa27ab8d3da77462 (patch) | |
tree | d474e218aea99ddddac547e65f13364bae9e7a42 /sys/kern | |
parent | fb5a10c01e716afcc0d5ba760af14f36af31a8ec (diff) |
When vmcmd_map_readvn() maps in the page it reads into, it forces
it to be writable but otherwise uses the correct final permissions.
Ergo, it only needs to call uvm_map_protect() if the requested
permissions didn't include UVM_PROT_WRITE.
ok beck@
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/exec_subr.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/kern/exec_subr.c b/sys/kern/exec_subr.c index 489dbddcff7..45708838117 100644 --- a/sys/kern/exec_subr.c +++ b/sys/kern/exec_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: exec_subr.c,v 1.32 2014/03/28 17:57:11 mpi Exp $ */ +/* $OpenBSD: exec_subr.c,v 1.33 2014/05/29 05:05:34 guenther Exp $ */ /* $NetBSD: exec_subr.c,v 1.9 1994/12/04 03:10:42 mycroft Exp $ */ /* @@ -248,9 +248,9 @@ vmcmd_map_readvn(struct proc *p, struct exec_vmcmd *cmd) if (error) return (error); - if (cmd->ev_prot != (VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE)) { + if ((prot & VM_PROT_WRITE) == 0) { /* - * we had to map in the area at PROT_ALL so that vn_rdwr() + * we had to map in the area at PROT_WRITE so that vn_rdwr() * could write to it. however, the caller seems to want * it mapped read-only, so now we are going to have to call * uvm_map_protect() to fix up the protection. ICK. |