svn commit: r269167 - stable/10/sys/fs/tmpfs

Konstantin Belousov kib at FreeBSD.org
Mon Jul 28 01:01:21 UTC 2014


Author: kib
Date: Mon Jul 28 01:01:20 2014
New Revision: 269167
URL: http://svnweb.freebsd.org/changeset/base/269167

Log:
  MFC r268608:
  The tmpfs_link() must not dereference the filesystem-specific data for
  a vnode until it is verified that the vnode indeed belongs to tmpfs mount.

Modified:
  stable/10/sys/fs/tmpfs/tmpfs_vnops.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/fs/tmpfs/tmpfs_vnops.c
==============================================================================
--- stable/10/sys/fs/tmpfs/tmpfs_vnops.c	Mon Jul 28 00:57:28 2014	(r269166)
+++ stable/10/sys/fs/tmpfs/tmpfs_vnops.c	Mon Jul 28 01:01:20 2014	(r269167)
@@ -570,8 +570,6 @@ tmpfs_link(struct vop_link_args *v)
 	MPASS(cnp->cn_flags & HASBUF);
 	MPASS(dvp != vp); /* XXX When can this be false? */
 
-	node = VP_TO_TMPFS_NODE(vp);
-
 	/* XXX: Why aren't the following two tests done by the caller? */
 
 	/* Hard links of directories are forbidden. */
@@ -586,6 +584,8 @@ tmpfs_link(struct vop_link_args *v)
 		goto out;
 	}
 
+	node = VP_TO_TMPFS_NODE(vp);
+
 	/* Ensure that we do not overflow the maximum number of links imposed
 	 * by the system. */
 	MPASS(node->tn_links <= LINK_MAX);


More information about the svn-src-all mailing list