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
This commit is contained in:
Tycho Nightingale 2018-06-08 20:35:58 +00:00
parent a62b4665f4
commit 4d20e87b7e
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=334856

View File

@ -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))