-/* $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 $ */
/*
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);
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);
}
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;
}