From 4584f3c24242d21c45db75df904235400fac34cc Mon Sep 17 00:00:00 2001 From: kettenis Date: Tue, 14 Sep 2021 16:16:51 +0000 Subject: [PATCH] Make pmap_extract() mpsafe by grabbing the kernel lock for userland pmaps while walking the page tables. ok deraadt@ --- sys/arch/hppa/hppa/pmap.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/arch/hppa/hppa/pmap.c b/sys/arch/hppa/hppa/pmap.c index 52f2c73ae9c..b1dbcf437e7 100644 --- a/sys/arch/hppa/hppa/pmap.c +++ b/sys/arch/hppa/hppa/pmap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.c,v 1.176 2021/09/05 11:44:46 mpi Exp $ */ +/* $OpenBSD: pmap.c,v 1.177 2021/09/14 16:16:51 kettenis Exp $ */ /* * Copyright (c) 1998-2004 Michael Shalayeff @@ -1090,7 +1090,10 @@ pmap_extract(struct pmap *pmap, vaddr_t va, paddr_t *pap) DPRINTF(PDB_FOLLOW|PDB_EXTRACT, ("pmap_extract(%p, %lx)\n", pmap, va)); + pmap_lock(pmap); pte = pmap_vp_find(pmap, va); + pmap_unlock(pmap); + if (pte) { if (pap) *pap = (pte & ~PGOFSET) | (va & PGOFSET); -- 2.20.1