diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2022-10-07 14:59:40 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2022-10-07 14:59:40 +0000 |
commit | d5dc31a79f667c4cedbee1fd924cce6958a38693 (patch) | |
tree | 5833d6d11a134abb7146ebe6af3404f801cdbda2 /sys/kern/kern_resource.c | |
parent | f06f83d9171fd070aa1dfb4cadffa776031c8a0a (diff) |
Add mimmutable(2) system call which locks the permissions (PROT_*) of
memory mappings so they cannot be changed by a later mmap(), mprotect(),
or munmap(), which will error with EPERM instead.
ok kettenis
Diffstat (limited to 'sys/kern/kern_resource.c')
-rw-r--r-- | sys/kern/kern_resource.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/kern/kern_resource.c b/sys/kern/kern_resource.c index 0c69d717017..38da9b1a312 100644 --- a/sys/kern/kern_resource.c +++ b/sys/kern/kern_resource.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_resource.c,v 1.74 2022/05/28 03:47:43 deraadt Exp $ */ +/* $OpenBSD: kern_resource.c,v 1.75 2022/10/07 14:59:39 deraadt Exp $ */ /* $NetBSD: kern_resource.c,v 1.38 1996/10/23 07:19:38 matthias Exp $ */ /*- @@ -328,8 +328,8 @@ dosetrlimit(struct proc *p, u_int which, struct rlimit *limp) addr = trunc_page(addr); size = round_page(size); KERNEL_LOCK(); - (void) uvm_map_protect(&vm->vm_map, - addr, addr+size, prot, FALSE); + (void) uvm_map_protect(&vm->vm_map, addr, + addr+size, prot, FALSE, FALSE); KERNEL_UNLOCK(); } } |