Commit d8c8133e authored by Ben Hutchings's avatar Ben Hutchings

vfs: Fix vfsmount_lock imbalance in path_init()

When backporting commit 4023bfc9 ("be careful with nd->inode in
path_init() and follow_dotdot_rcu()"), I failed to account for the
vfsmount_lock that is used in 3.2 but not upstream.  path_init() takes
the lock if performing RCU lookup, but must drop it if (and only if)
it subsequently fails.

Reported-by: nuxi@vault24.org
References: https://bugzilla.kernel.org/show_bug.cgi?id=92531Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
Tested-by: nuxi@vault24.org
parent 5fa7469e
......@@ -1567,6 +1567,7 @@ static int path_init(int dfd, const char *name, unsigned int flags,
if (!(nd->flags & LOOKUP_ROOT))
nd->root.mnt = NULL;
rcu_read_unlock();
br_read_unlock(vfsmount_lock);
return -ECHILD;
fput_fail:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment