diff options
| author | 2014-05-29 05:05:34 +0000 | |
|---|---|---|
| committer | 2014-05-29 05:05:34 +0000 | |
| commit | fd6bec850e62af7a28dfc5326a738155c359b68e (patch) | |
| tree | 43f57bbde9d148b9647d86595b10a16046f36b94 /sys/kern/exec_subr.c | |
| parent | To get a random seed, just call arc4random() instead of reading a (diff) | |
| download | wireguard-openbsd-fd6bec850e62af7a28dfc5326a738155c359b68e.tar.xz wireguard-openbsd-fd6bec850e62af7a28dfc5326a738155c359b68e.zip | |
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/exec_subr.c')
| -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. |
