summaryrefslogtreecommitdiffstats
path: root/sys/vm
diff options
context:
space:
mode:
authortjr <tjr@FreeBSD.org>2004-05-11 10:26:37 +0000
committertjr <tjr@FreeBSD.org>2004-05-11 10:26:37 +0000
commita87b9baadb4b8eea53204f4c09ef0f80885a15f1 (patch)
treeee058743cc36cb2a772e76e651e0a5e2b4a8a067 /sys/vm
parent23826bb4100062044395517612bce82de92d3ebf (diff)
downloadFreeBSD-src-a87b9baadb4b8eea53204f4c09ef0f80885a15f1.zip
FreeBSD-src-a87b9baadb4b8eea53204f4c09ef0f80885a15f1.tar.gz
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.
Diffstat (limited to 'sys/vm')
-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 69079ea..3731bf4 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;
OpenPOWER on IntegriCloud