svn commit: r308644 - head/sys/riscv/riscv

Ruslan Bukin br at FreeBSD.org
Mon Nov 14 18:30:04 UTC 2016


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;
 


More information about the svn-src-all mailing list