Author: kib
Date: Tue Sep 11 18:39:04 2018
New Revision: 338595
URL: https://svnweb.freebsd.org/changeset/base/338595

Log:
  MFC r334856, r338434:
  Don't bother looking for non-executable pages when a process is
  excluded from PTI.

Modified:
  stable/11/sys/amd64/amd64/trap.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/amd64/amd64/trap.c
==============================================================================
--- stable/11/sys/amd64/amd64/trap.c    Tue Sep 11 18:35:08 2018        
(r338594)
+++ stable/11/sys/amd64/amd64/trap.c    Tue Sep 11 18:39:04 2018        
(r338595)
@@ -770,7 +770,8 @@ trap_pfault(struct trapframe *frame, int usermode)
         * If nx protection of the usermode portion of kernel page
         * tables caused trap, panic.
         */
-       if (pti && usermode && pg_nx != 0 && (frame->tf_err & (PGEX_P | PGEX_W |
+       if (usermode && PCPU_GET(curpmap)->pm_ucr3 != PMAP_NO_CR3 &&
+           pg_nx != 0 && (frame->tf_err & (PGEX_P | PGEX_W |
            PGEX_U | PGEX_I)) == (PGEX_P | PGEX_U | PGEX_I) &&
            (curpcb->pcb_saved_ucr3 & ~CR3_PCID_MASK)==
            (PCPU_GET(curpmap)->pm_cr3 & ~CR3_PCID_MASK))
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to