svn commit: r199357 - stable/8/sys/kern
Konstantin Belousov
kib at FreeBSD.org
Tue Nov 17 11:46:55 UTC 2009
Author: kib
Date: Tue Nov 17 11:46:55 2009
New Revision: 199357
URL: http://svn.freebsd.org/changeset/base/199357
Log:
MFC r199137:
Detect the slashdot lookup for RENAME or REMOVE in lookup(), and return
EINVAL.
Modified:
stable/8/sys/kern/vfs_lookup.c
Directory Properties:
stable/8/sys/ (props changed)
stable/8/sys/amd64/include/xen/ (props changed)
stable/8/sys/cddl/contrib/opensolaris/ (props changed)
stable/8/sys/contrib/dev/acpica/ (props changed)
stable/8/sys/contrib/pf/ (props changed)
stable/8/sys/dev/xen/xenpci/ (props changed)
stable/8/sys/netinet6/ (props changed)
Modified: stable/8/sys/kern/vfs_lookup.c
==============================================================================
--- stable/8/sys/kern/vfs_lookup.c Tue Nov 17 11:43:53 2009 (r199356)
+++ stable/8/sys/kern/vfs_lookup.c Tue Nov 17 11:46:55 2009 (r199357)
@@ -552,6 +552,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 "")
More information about the svn-src-stable-8
mailing list