1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-02-06 18:29:47 +00:00

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@
This commit is contained in:
Alan Cox 2006-08-14 06:15:16 +00:00
parent 1e6fdb7e32
commit 3173042ecc
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=161272

View File

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