Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 14 Nov 2016 18:30:03 +0000 (UTC)
From:      Ruslan Bukin <br@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r308644 - head/sys/riscv/riscv
Message-ID:  <201611141830.uAEIU35P020976@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: br
Date: Mon Nov 14 18:30:03 2016
New Revision: 308644
URL: https://svnweb.freebsd.org/changeset/base/308644

Log:
  Check if L2 entry exists for the given VA before loading L3 entry.
  
  This is a fix for a panic that was easy to reproduce executing
  "(/bin/ls &)" in the shell.
  
  Sponsored by:	DARPA, AFRL

Modified:
  head/sys/riscv/riscv/pmap.c

Modified: head/sys/riscv/riscv/pmap.c
==============================================================================
--- head/sys/riscv/riscv/pmap.c	Mon Nov 14 17:19:03 2016	(r308643)
+++ head/sys/riscv/riscv/pmap.c	Mon Nov 14 18:30:03 2016	(r308644)
@@ -1992,6 +1992,8 @@ pmap_protect(pmap_t pmap, vm_offset_t sv
 		l2 = pmap_l1_to_l2(l1, sva);
 		if (l2 == NULL)
 			continue;
+		if (pmap_load(l2) == 0)
+			continue;
 		if ((pmap_load(l2) & PTE_RX) != 0)
 			continue;
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201611141830.uAEIU35P020976>