From 5d3b3ef61cc3810568949358b7eedad4a0736edc Mon Sep 17 00:00:00 2001 From: miod Date: Wed, 8 Jan 2014 17:12:18 +0000 Subject: [PATCH] Be sure to have pmap_extract() return FALSE for existing, but non-valid user pmap ptes. Found the hard way by tobiasu@. --- sys/arch/mips64/mips64/pmap.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sys/arch/mips64/mips64/pmap.c b/sys/arch/mips64/mips64/pmap.c index fce96132e20..c6b4bcce8d6 100644 --- a/sys/arch/mips64/mips64/pmap.c +++ b/sys/arch/mips64/mips64/pmap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.c,v 1.66 2012/10/03 22:46:07 miod Exp $ */ +/* $OpenBSD: pmap.c,v 1.67 2014/01/08 17:12:18 miod Exp $ */ /* * Copyright (c) 2001-2004 Opsycon AB (www.opsycon.se / www.opsycon.com) @@ -1172,7 +1172,10 @@ pmap_extract(pmap_t pmap, vaddr_t va, paddr_t *pap) rv = FALSE; else { pte += uvtopte(va); - pa = pfn_to_pad(*pte) | (va & PAGE_MASK); + if (*pte & PG_V) + pa = pfn_to_pad(*pte) | (va & PAGE_MASK); + else + rv = FALSE; } } if (rv != FALSE) -- 2.20.1