Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2788cc47 authored by Al Viro's avatar Al Viro
Browse files

Don't reset ->total_link_count on nested calls of vfs_path_lookup()



we already zero it on outermost set_nameidata(), so initialization in
path_init() is pointless and wrong.  The same DoS exists on pre-4.2
kernels, but there a slightly different fix will be needed.

Cc: stable@vger.kernel.org # v4.2
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 0f7ff2da
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -1996,7 +1996,6 @@ static const char *path_init(struct nameidata *nd, unsigned flags)
	nd->last_type = LAST_ROOT; /* if there are only slashes... */
	nd->flags = flags | LOOKUP_JUMPED | LOOKUP_PARENT;
	nd->depth = 0;
	nd->total_link_count = 0;
	if (flags & LOOKUP_ROOT) {
		struct dentry *root = nd->root.dentry;
		struct inode *inode = root->d_inode;