diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2022-10-21 20:46:41 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2022-10-21 20:46:41 +0000 |
commit | 459f6588f95e74ed6905b3b21532050af4faf8eb (patch) | |
tree | d049f4e525648280a9008bc3ab2d5e2515fff8cb | |
parent | ab46db73a8957eb240753f6064f8057e6059f3ed (diff) |
uvm_map_immutable() takes start,end, not start,end
I juggled my trees incorrectly.
-rw-r--r-- | sys/kern/exec_subr.c | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/sys/kern/exec_subr.c b/sys/kern/exec_subr.c index 4ed04765788..ac787ab8be1 100644 --- a/sys/kern/exec_subr.c +++ b/sys/kern/exec_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: exec_subr.c,v 1.61 2022/10/21 19:13:31 deraadt Exp $ */ +/* $OpenBSD: exec_subr.c,v 1.62 2022/10/21 20:46:40 deraadt Exp $ */ /* $NetBSD: exec_subr.c,v 1.9 1994/12/04 03:10:42 mycroft Exp $ */ /* @@ -213,8 +213,8 @@ vmcmd_map_pagedvn(struct proc *p, struct exec_vmcmd *cmd) uobj->pgops->pgo_detach(uobj); } else { if (cmd->ev_flags & VMCMD_IMMUTABLE) - uvm_map_immutable(&p->p_vmspace->vm_map, - cmd->ev_addr, round_page(cmd->ev_len), 1); + uvm_map_immutable(&p->p_vmspace->vm_map, cmd->ev_addr, + round_page(cmd->ev_addr + cmd->ev_len), 1); } return (error); @@ -265,11 +265,9 @@ vmcmd_map_readvn(struct proc *p, struct exec_vmcmd *cmd) prot, FALSE, TRUE)); } if (error == 0) { - if (cmd->ev_flags & VMCMD_IMMUTABLE) { - //printf("imut readvn\n"); - uvm_map_immutable(&p->p_vmspace->vm_map, - cmd->ev_addr, round_page(cmd->ev_len), 1); - } + if (cmd->ev_flags & VMCMD_IMMUTABLE) + uvm_map_immutable(&p->p_vmspace->vm_map, cmd->ev_addr, + round_page(cmd->ev_addr + cmd->ev_len), 1); } return (error); } @@ -293,11 +291,9 @@ vmcmd_map_zero(struct proc *p, struct exec_vmcmd *cmd) UVM_MAPFLAG(cmd->ev_prot, PROT_MASK, MAP_INHERIT_COPY, MADV_NORMAL, UVM_FLAG_FIXED|UVM_FLAG_COPYONW | (cmd->ev_flags & VMCMD_STACK ? UVM_FLAG_STACK : 0))); - if (cmd->ev_flags & VMCMD_IMMUTABLE) { - //printf("imut zero\n"); - uvm_map_immutable(&p->p_vmspace->vm_map, - cmd->ev_addr, round_page(cmd->ev_len), 1); - } + if (cmd->ev_flags & VMCMD_IMMUTABLE) + uvm_map_immutable(&p->p_vmspace->vm_map, cmd->ev_addr, + round_page(cmd->ev_addr + cmd->ev_len), 1); return error; } |