-/* $OpenBSD: exec_subr.c,v 1.59 2022/10/21 18:10:56 deraadt Exp $ */
+/* $OpenBSD: exec_subr.c,v 1.60 2022/10/21 18:11:55 deraadt Exp $ */
/* $NetBSD: exec_subr.c,v 1.9 1994/12/04 03:10:42 mycroft Exp $ */
/*
* <stack> ep_minsaddr
*/
#ifdef MACHINE_STACK_GROWS_UP
- NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_zero,
+ NEW_VMCMD2(&epp->ep_vmcmds, vmcmd_map_zero,
((epp->ep_minsaddr - epp->ep_ssize) - epp->ep_maxsaddr),
- epp->ep_maxsaddr + epp->ep_ssize, NULLVP, 0,
- PROT_NONE);
+ epp->ep_maxsaddr + epp->ep_ssize,
+ NULLVP, 0, PROT_NONE, VMCMD_IMMUTABLE);
NEW_VMCMD2(&epp->ep_vmcmds, vmcmd_map_zero, epp->ep_ssize,
- epp->ep_maxsaddr, NULLVP, 0,
- PROT_READ | PROT_WRITE, VMCMD_STACK);
+ epp->ep_maxsaddr,
+ NULLVP, 0, PROT_READ | PROT_WRITE, VMCMD_STACK | VMCMD_IMMUTABLE);
#else
- NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_zero,
+ NEW_VMCMD2(&epp->ep_vmcmds, vmcmd_map_zero,
((epp->ep_minsaddr - epp->ep_ssize) - epp->ep_maxsaddr),
- epp->ep_maxsaddr, NULLVP, 0,
- PROT_NONE);
+ epp->ep_maxsaddr,
+ NULLVP, 0, PROT_NONE, VMCMD_IMMUTABLE);
NEW_VMCMD2(&epp->ep_vmcmds, vmcmd_map_zero, epp->ep_ssize,
- (epp->ep_minsaddr - epp->ep_ssize), NULLVP, 0,
- PROT_READ | PROT_WRITE, VMCMD_STACK);
+ (epp->ep_minsaddr - epp->ep_ssize),
+ NULLVP, 0, PROT_READ | PROT_WRITE, VMCMD_STACK | VMCMD_IMMUTABLE);
#endif
return (0);
-/* $OpenBSD: kern_exec.c,v 1.235 2022/10/12 02:39:16 deraadt Exp $ */
+/* $OpenBSD: kern_exec.c,v 1.236 2022/10/21 18:11:55 deraadt Exp $ */
/* $NetBSD: kern_exec.c,v 1.75 1996/02/09 18:59:28 christos Exp $ */
/*-
#ifdef MACHINE_STACK_GROWS_UP
pr->ps_strings = (vaddr_t)vm->vm_maxsaddr + sgap;
if (uvm_map_protect(&vm->vm_map, (vaddr_t)vm->vm_maxsaddr,
- trunc_page(pr->ps_strings), PROT_NONE, TRUE, TRUE))
+ trunc_page(pr->ps_strings), PROT_NONE, TRUE, FALSE))
goto exec_abort;
#else
pr->ps_strings = (vaddr_t)vm->vm_minsaddr - sizeof(arginfo) - sgap;
if (uvm_map_protect(&vm->vm_map,
round_page(pr->ps_strings + sizeof(arginfo)),
- (vaddr_t)vm->vm_minsaddr, PROT_NONE, TRUE, TRUE))
+ (vaddr_t)vm->vm_minsaddr, PROT_NONE, TRUE, FALSE))
goto exec_abort;
#endif