Author: kib
Date: Sat Feb 19 07:47:25 2011
New Revision: 218838
URL: http://svn.freebsd.org/changeset/base/218838

Log:
  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>

Modified:
  head/sys/ufs/ufs/ufs_vnops.c

Modified: head/sys/ufs/ufs/ufs_vnops.c
==============================================================================
--- head/sys/ufs/ufs/ufs_vnops.c        Sat Feb 19 07:45:17 2011        
(r218837)
+++ head/sys/ufs/ufs/ufs_vnops.c        Sat Feb 19 07:47:25 2011        
(r218838)
@@ -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;
        }
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to