From 8a399d9cbddef27688d2a3acacb00ac45ec78ad8 Mon Sep 17 00:00:00 2001 From: deraadt Date: Fri, 21 Oct 2022 20:45:51 +0000 Subject: [PATCH] Recent chrome renderers try to change some immutable RW region to R. I really want immutable to not allow such transitions either, because it will help bring code up to the highest standard. For now, allow this for all processes, until we find out the underlying reason. --- sys/uvm/uvm_map.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/sys/uvm/uvm_map.c b/sys/uvm/uvm_map.c index 4bfab632046..130c57b4b24 100644 --- a/sys/uvm/uvm_map.c +++ b/sys/uvm/uvm_map.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_map.c,v 1.299 2022/10/21 19:13:32 deraadt Exp $ */ +/* $OpenBSD: uvm_map.c,v 1.300 2022/10/21 20:45:51 deraadt Exp $ */ /* $NetBSD: uvm_map.c,v 1.86 2000/11/27 08:40:03 chs Exp $ */ /* @@ -3139,8 +3139,18 @@ uvm_map_protect(struct vm_map *map, vaddr_t start, vaddr_t end, if (checkimmutable && (iter->etype & UVM_ET_IMMUTABLE)) { - error = EPERM; - goto out; + if (iter->protection == (PROT_READ | PROT_WRITE) && + new_prot == PROT_READ) { + /* + * XXX chrome renderer on 2022oct21 does a + * RW->R transition of some immutable range. + * Workaround this until it is found... + */ + ; + } else { + error = EPERM; + goto out; + } } old_prot = iter->protection; if (old_prot == PROT_NONE && new_prot != old_prot) { -- 2.20.1