To handle orphaned character device vnodes properly in mmap(), check that

v_mount is non-null before dereferencing it. If it's null, behave as if
MNT_NOEXEC was not set on the mount that originally containined it.
This commit is contained in:
tjr 2004-05-11 10:26:37 +00:00
parent 23826bb410
commit a87b9baadb

View File

@ -320,7 +320,7 @@ mmap(td, uap)
* credentials do we use for determination? What if
* proc does a setuid?
*/
if (vp->v_mount->mnt_flag & MNT_NOEXEC)
if (vp->v_mount != NULL && vp->v_mount->mnt_flag & MNT_NOEXEC)
maxprot = VM_PROT_NONE;
else
maxprot = VM_PROT_EXECUTE;