summaryrefslogtreecommitdiffstats
path: root/sys/ufs
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2011-02-19 07:47:25 +0000
committerkib <kib@FreeBSD.org>2011-02-19 07:47:25 +0000
commit1d3d8b3035bb01839778cb25454e660585280eca (patch)
tree2659674b24a712d0ca31e8ec9ddb2fae22d6aad7 /sys/ufs
parent6375e08d89918f06773dc739bb1ac1599d5d37d8 (diff)
downloadFreeBSD-src-1d3d8b3035bb01839778cb25454e660585280eca.zip
FreeBSD-src-1d3d8b3035bb01839778cb25454e660585280eca.tar.gz
v_mountedhere is a member of the union. Check that the vnodes have
proper type before using the member. Reported and tested by: Michael Butler <imb protected-networks net>
Diffstat (limited to 'sys/ufs')
-rw-r--r--sys/ufs/ufs/ufs_vnops.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c
index 084971e..34b1758 100644
--- a/sys/ufs/ufs/ufs_vnops.c
+++ b/sys/ufs/ufs/ufs_vnops.c
@@ -1295,7 +1295,9 @@ relock:
newparent = tdp->i_number;
doingdirectory = 1;
}
- if (fvp->v_mountedhere != NULL || (tvp && tvp->v_mountedhere != NULL)) {
+ if ((fvp->v_type == VDIR && fvp->v_mountedhere != NULL) ||
+ (tvp != NULL && tvp->v_type == VDIR &&
+ tvp->v_mountedhere != NULL)) {
error = EXDEV;
goto unlockout;
}
OpenPOWER on IntegriCloud