From 7376e01d721241bfb6a26b9ce726ec2ab2286d73 Mon Sep 17 00:00:00 2001 From: guenther Date: Thu, 3 Feb 2022 19:57:11 +0000 Subject: [PATCH] The sparc64 pmap at least requires the fault access_type to be a subset of the request permissions, so when forcing an initial RO fault for CoW also clamp the access_type. problem reported by bluhm@ based on a suggestion from miod@ ok kettenis@ --- sys/uvm/uvm_fault.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/uvm/uvm_fault.c b/sys/uvm/uvm_fault.c index 312ba2b33d6..e7a54be4c5a 100644 --- a/sys/uvm/uvm_fault.c +++ b/sys/uvm/uvm_fault.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_fault.c,v 1.125 2022/02/01 08:38:53 guenther Exp $ */ +/* $OpenBSD: uvm_fault.c,v 1.126 2022/02/03 19:57:11 guenther Exp $ */ /* $NetBSD: uvm_fault.c,v 1.51 2000/08/06 00:22:53 thorpej Exp $ */ /* @@ -1022,8 +1022,10 @@ uvm_fault_upper(struct uvm_faultinfo *ufi, struct uvm_faultctx *flt, * uvm does it by inserting the new mapping RO and * letting it fault again. */ - if (P_HASSIBLING(curproc)) + if (P_HASSIBLING(curproc)) { flt->enter_prot &= ~PROT_WRITE; + flt->access_type &= ~PROT_WRITE; + } #endif /* -- 2.20.1