-.\" $OpenBSD: mimmutable.2,v 1.3 2022/11/06 20:15:44 jmc Exp $
+.\" $OpenBSD: mimmutable.2,v 1.4 2024/01/20 13:19:37 deraadt Exp $
.\"
.\" Copyright (c) 1991, 1993
.\" The Regents of the University of California. All rights reserved.
.\"
.\" @(#)mimmutable.2 8.1 (Berkeley) 6/9/93
.\"
-.Dd $Mdocdate: November 6 2022 $
+.Dd $Mdocdate: January 20 2024 $
.Dt MIMMUTABLE 2
.Os
.Sh NAME
.Fn mimmutable
function first appeared in
.Ox 7.3 .
-.Sh CAVEATS
-At present,
-.Xr mprotect 2
-may reduce permissions on immutable pages marked
-.Dv PROT_READ | PROT_WRITE
-to the less permissive
-.Dv PROT_READ .
-This one-way operation is permitted for an introductory period to observe how
-software uses this mechanism.
-It may change to require explicit mutable region annotation with
-.Va __attribute__((section(".openbsd.mutable")))
-and explicit calls to
-.Fn mimmutable .
-/* $OpenBSD: uvm_map.c,v 1.320 2024/01/16 19:05:01 deraadt Exp $ */
+/* $OpenBSD: uvm_map.c,v 1.321 2024/01/20 13:19:39 deraadt Exp $ */
/* $NetBSD: uvm_map.c,v 1.86 2000/11/27 08:40:03 chs Exp $ */
/*
if (iter->start == iter->end || UVM_ET_ISHOLE(iter))
continue;
- if (checkimmutable &&
- (iter->etype & UVM_ET_IMMUTABLE)) {
- if (iter->protection == (PROT_READ | PROT_WRITE) &&
- new_prot == PROT_READ) {
- /* Permit RW to R as a data-locking mechanism */
- ;
- } else {
- error = EPERM;
- goto out;
- }
+ if (checkimmutable && (iter->etype & UVM_ET_IMMUTABLE)) {
+ error = EPERM;
+ goto out;
}
old_prot = iter->protection;
if (old_prot == PROT_NONE && new_prot != old_prot) {