Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 19 Feb 2011 07:47:26 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r218838 - head/sys/ufs/ufs
Message-ID:  <201102190747.p1J7lQe6088196@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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;
 	}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201102190747.p1J7lQe6088196>