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

Jessica Clarke jrtc27 at FreeBSD.org
Wed May 13 17:20:52 UTC 2020


Author: jrtc27
Date: Wed May 13 17:20:51 2020
New Revision: 361010
URL: https://svnweb.freebsd.org/changeset/base/361010

Log:
  riscv: Fix pmap_protect for superpages
  
  When protecting a superpage, we would previously fall through to the
  non-superpage case and read the contents of the superpage as PTEs,
  potentially modifying them and trying to look up underlying VM pages that
  don't exist if they happen to look like PTEs we would care about. This led
  to nginx causing an unexpected page fault in pmap_protect that panic'ed the
  kernel. Instead, if we see a superpage, we are done for this range and
  should continue to the next.
  
  Reviewed by:	markj, jhb (mentor)
  Approved by:	markj, jhb (mentor)
  Differential Revision:	https://reviews.freebsd.org/D24827

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

Modified: head/sys/riscv/riscv/pmap.c
==============================================================================
--- head/sys/riscv/riscv/pmap.c	Wed May 13 16:36:42 2020	(r361009)
+++ head/sys/riscv/riscv/pmap.c	Wed May 13 17:20:51 2020	(r361010)
@@ -2329,6 +2329,7 @@ retryl2:
 				if (!atomic_fcmpset_long(l2, &l2e, l2e & ~mask))
 					goto retryl2;
 				anychanged = true;
+				continue;
 			} else {
 				if (!pv_lists_locked) {
 					pv_lists_locked = true;


More information about the svn-src-all mailing list