Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 8 Jun 2018 20:35:59 +0000 (UTC)
From:      Tycho Nightingale <tychon@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r334856 - head/sys/amd64/amd64
Message-ID:  <201806082035.w58KZxmA085837@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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))



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201806082035.w58KZxmA085837>