diff --git a/sys/amd64/amd64/trap.c b/sys/amd64/amd64/trap.c index 1b6488f22e8..daad6829043 100644 --- a/sys/amd64/amd64/trap.c +++ b/sys/amd64/amd64/trap.c @@ -568,11 +568,11 @@ trap_pfault(frame, usermode) /* * PGEX_I is defined only if the execute disable bit capability is - * supported and enabled; otherwise, that bit is reserved, i.e., zero. + * supported and enabled. */ if (frame->tf_err & PGEX_W) ftype = VM_PROT_WRITE; - else if (frame->tf_err & PGEX_I) + else if ((frame->tf_err & PGEX_I) && pg_nx != 0) ftype = VM_PROT_EXECUTE; else ftype = VM_PROT_READ;