diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2022-10-08 16:58:35 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2022-10-08 16:58:35 +0000 |
commit | bac7aaedc056563406364103b198d96ce0516cb3 (patch) | |
tree | 51c1d45975b1a2afadad7c3af385c52ae21d7f4a | |
parent | e97df9adb61964e8dded2fe3aeb36cb1f4c2efc7 (diff) |
The signal trampoline and timekeep regions can be marked immutable at
execve() time
ok kettenis
-rw-r--r-- | sys/kern/kern_exec.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c index 761441cd2dd..af474ee7d8d 100644 --- a/sys/kern/kern_exec.c +++ b/sys/kern/kern_exec.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_exec.c,v 1.232 2022/10/07 14:59:39 deraadt Exp $ */ +/* $OpenBSD: kern_exec.c,v 1.233 2022/10/08 16:58:34 deraadt Exp $ */ /* $NetBSD: kern_exec.c,v 1.75 1996/02/09 18:59:28 christos Exp $ */ /*- @@ -863,6 +863,8 @@ exec_sigcode_map(struct process *pr) uao_detach(sigobject); return (ENOMEM); } + uvm_map_immutable(&pr->ps_vmspace->vm_map, pr->ps_sigcode, + pr->ps_sigcode + round_page(sz), 1, "sig"); /* Calculate PC at point of sigreturn entry */ pr->ps_sigcoderet = pr->ps_sigcode + (sigcoderet - sigcode); @@ -911,6 +913,8 @@ exec_timekeep_map(struct process *pr) uao_detach(timekeep_object); return (ENOMEM); } + uvm_map_immutable(&pr->ps_vmspace->vm_map, pr->ps_timekeep, + pr->ps_timekeep + timekeep_sz, 1, "time"); return (0); } |