Author: tychon
Date: Fri Jun  8 20:35:58 2018
New Revision: 334856
URL: https://svnweb.freebsd.org/changeset/base/334856

Log:
  Don't bother looking for non-executable pages when a process is
  excluded from PTI.
  
  Reviewed by:  kib
  Sponsored by: Dell EMC Isilon
  Differential Revision:        https://reviews.freebsd.org/D15708

Modified:
  head/sys/amd64/amd64/trap.c

Modified: head/sys/amd64/amd64/trap.c
==============================================================================
--- head/sys/amd64/amd64/trap.c Fri Jun  8 20:31:59 2018        (r334855)
+++ head/sys/amd64/amd64/trap.c Fri Jun  8 20:35:58 2018        (r334856)
@@ -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 (PCPU_GET(curpmap)->pm_ucr3 != PMAP_NO_CR3 && usermode &&
+           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))
_______________________________________________
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