Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 17 Nov 2009 12:11:12 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
Subject:   svn commit: r199359 - stable/7/sys/kern
Message-ID:  <200911171211.nAHCBCxB006216@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Tue Nov 17 12:11:12 2009
New Revision: 199359
URL: http://svn.freebsd.org/changeset/base/199359

Log:
  MFC r199137:
  Detect the slashdot lookup for RENAME or REMOVE in lookup(), and return
  EINVAL.

Modified:
  stable/7/sys/kern/vfs_lookup.c
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/kern/vfs_lookup.c
==============================================================================
--- stable/7/sys/kern/vfs_lookup.c	Tue Nov 17 12:09:21 2009	(r199358)
+++ stable/7/sys/kern/vfs_lookup.c	Tue Nov 17 12:11:12 2009	(r199359)
@@ -464,6 +464,12 @@ dirloop:
 	else
 		cnp->cn_flags &= ~ISLASTCN;
 
+	if ((cnp->cn_flags & ISLASTCN) != 0 &&
+	    cnp->cn_namelen == 1 && cnp->cn_nameptr[0] == '.' &&
+	    (cnp->cn_nameiop == DELETE || cnp->cn_nameiop == RENAME)) {
+		error = EINVAL;
+		goto bad;
+	}
 
 	/*
 	 * Check for degenerate name (e.g. / or "")



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