diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2014-01-08 17:12:19 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2014-01-08 17:12:19 +0000 |
commit | 5e5b0484109d1817a3534beb913a2c3f8f3e84b4 (patch) | |
tree | e2b21403eda540dfd6fac252928e5ead44505bdb /sys/arch | |
parent | b272bc82997e29ffaf4ead1f8bd5434ce6899fd5 (diff) |
Be sure to have pmap_extract() return FALSE for existing, but non-valid user
pmap ptes. Found the hard way by tobiasu@.
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/mips64/mips64/pmap.c | 7 |
1 files 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) |