Author: skra
Date: Tue Nov 10 13:15:34 2015
New Revision: 290655
URL: https://svnweb.freebsd.org/changeset/base/290655

Log:
  Fix pmap_fault(). It turned out that alignment abort may have higher
  priority than both translation and permission ones.
  
  Approved by:  kib (mentor)

Modified:
  head/sys/arm/arm/pmap-v6-new.c

Modified: head/sys/arm/arm/pmap-v6-new.c
==============================================================================
--- head/sys/arm/arm/pmap-v6-new.c      Tue Nov 10 13:11:22 2015        
(r290654)
+++ head/sys/arm/arm/pmap-v6-new.c      Tue Nov 10 13:15:34 2015        
(r290655)
@@ -6152,8 +6152,9 @@ pmap_fault(pmap_t pmap, vm_offset_t far,
                 * All L1 tables should always be mapped and present.
                 * However, we check only current one herein. For user mode,
                 * only permission abort from malicious user is not fatal.
+                * And alignment abort as it may have higher priority.
                 */
-               if (!usermode || (idx != FAULT_PERM_L2)) {
+               if (!usermode || (idx != FAULT_ALIGN && idx != FAULT_PERM_L2)) {
                        CTR4(KTR_PMAP, "%s: pmap %#x pm_pt1 %#x far %#x",
                            __func__, pmap, pmap->pm_pt1, far);
                        panic("%s: pm_pt1 abort", __func__);
@@ -6166,9 +6167,10 @@ pmap_fault(pmap_t pmap, vm_offset_t far,
                 * L1 table. However, only existing L2 tables are mapped
                 * in PT2MAP. For user mode, only L2 translation abort and
                 * permission abort from malicious user is not fatal.
+                * And alignment abort as it may have higher priority.
                 */
-               if (!usermode ||
-                   (idx != FAULT_TRAN_L2 && idx != FAULT_PERM_L2)) {
+               if (!usermode || (idx != FAULT_ALIGN &&
+                   idx != FAULT_TRAN_L2 && idx != FAULT_PERM_L2)) {
                        CTR4(KTR_PMAP, "%s: pmap %#x PT2MAP %#x far %#x",
                            __func__, pmap, PT2MAP, far);
                        panic("%s: PT2MAP abort", __func__);
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to