From owner-svn-src-head@FreeBSD.ORG Sat Feb 19 07:47:26 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 48812106564A; Sat, 19 Feb 2011 07:47:26 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 37B578FC13; Sat, 19 Feb 2011 07:47:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1J7lQnh088198; Sat, 19 Feb 2011 07:47:26 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1J7lQe6088196; Sat, 19 Feb 2011 07:47:26 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201102190747.p1J7lQe6088196@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 19 Feb 2011 07:47:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218838 - head/sys/ufs/ufs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Feb 2011 07:47:26 -0000 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 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; }