summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2006-08-14 06:15:16 +0000
committeralc <alc@FreeBSD.org>2006-08-14 06:15:16 +0000
commit813df8630113217f100ba3304f91f40b46b5fc8e (patch)
tree64e70887c17e335e948ff654324d00bbd299150f
parent44c8c2fc9111b81fe22d4e0df84d975834fdfe66 (diff)
downloadFreeBSD-src-813df8630113217f100ba3304f91f40b46b5fc8e.zip
FreeBSD-src-813df8630113217f100ba3304f91f40b46b5fc8e.tar.gz
It's not entirely obvious that PGEX_I must be zero if no-execute is neither
supported nor enabled. Just to be sure, verify that no-execute is enabled before passing VM_PROT_EXECUTE to vm_fault(). Suggested by: tegge@
-rw-r--r--sys/amd64/amd64/trap.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/amd64/amd64/trap.c b/sys/amd64/amd64/trap.c
index 1b6488f..daad682 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;
OpenPOWER on IntegriCloud