aboutsummaryrefslogtreecommitdiff
path: root/sys/vm/vm_mmap.c
diff options
context:
space:
mode:
authorTim J. Robbins <tjr@FreeBSD.org>2004-05-11 10:26:37 +0000
committerTim J. Robbins <tjr@FreeBSD.org>2004-05-11 10:26:37 +0000
commit8eec77b09ebe63e2900c6504d656eb1451e0baa8 (patch)
treeee058743cc36cb2a772e76e651e0a5e2b4a8a067 /sys/vm/vm_mmap.c
parent70a9abdd457f8c371df0c12d1beeb65467c2950d (diff)
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.
Notes
Notes: svn path=/head/; revision=129110
Diffstat (limited to 'sys/vm/vm_mmap.c')
-rw-r--r--sys/vm/vm_mmap.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/vm/vm_mmap.c b/sys/vm/vm_mmap.c
index 69079ea8818b..3731bf459686 100644
--- a/sys/vm/vm_mmap.c
+++ b/sys/vm/vm_mmap.c
@@ -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;