diff options
author | Tycho Nightingale <tychon@FreeBSD.org> | 2018-06-08 20:35:58 +0000 |
---|---|---|
committer | Tycho Nightingale <tychon@FreeBSD.org> | 2018-06-08 20:35:58 +0000 |
commit | 4d20e87b7e2b762efcf4880fb636dc9b066ad6b6 (patch) | |
tree | 0651fc3ea543e06c3c7405e2d2b94a597b830740 /sys | |
parent | a62b4665f414ec030ed29ad8a8657bacd832d1c8 (diff) | |
download | src-4d20e87b7e2b762efcf4880fb636dc9b066ad6b6.tar.gz src-4d20e87b7e2b762efcf4880fb636dc9b066ad6b6.zip |
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
Notes
Notes:
svn path=/head/; revision=334856
Diffstat (limited to 'sys')
-rw-r--r-- | sys/amd64/amd64/trap.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/amd64/amd64/trap.c b/sys/amd64/amd64/trap.c index 362f349a1d90..0049e82d190c 100644 --- a/sys/amd64/amd64/trap.c +++ b/sys/amd64/amd64/trap.c @@ -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)) |