Date: Wed, 13 May 2020 17:20:51 +0000 (UTC) From: Jessica Clarke <jrtc27@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361010 - head/sys/riscv/riscv Message-ID: <202005131720.04DHKpZ0067875@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202005131720.04DHKpZ0067875>