Pass VM_PROT_EXECUTE to vm_fault() instead of VM_PROT_READ if the page

fault was caused by an instruction fetch.
This commit is contained in:
Alan Cox 2006-08-08 04:01:29 +00:00
parent 7d2498889f
commit 079ba18aac
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=161066

View file

@ -566,8 +566,14 @@ trap_pfault(frame, usermode)
map = &vm->vm_map;
}
/*
* PGEX_I is defined only if the execute disable bit capability is
* supported and enabled; otherwise, that bit is reserved, i.e., zero.
*/
if (frame->tf_err & PGEX_W)
ftype = VM_PROT_WRITE;
else if (frame->tf_err & PGEX_I)
ftype = VM_PROT_EXECUTE;
else
ftype = VM_PROT_READ;