diff options
author | Ben Hutchings <ben@decadent.org.uk> | 2015-02-16 03:21:17 +0000 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2015-02-20 00:49:41 +0000 |
commit | d8c8133eb0460a183e69cf8a5d722688916960de (patch) | |
tree | 7bf7fc98930c8db83b060f9ace0bf2c700d7a5b1 /fs | |
parent | 5fa7469e951f1ac4d193b1f5b457da1aa232c98a (diff) |
vfs: Fix vfsmount_lock imbalance in path_init()
When backporting commit 4023bfc9f351 ("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=92531
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Tested-by: nuxi@vault24.org
Diffstat (limited to 'fs')
-rw-r--r-- | fs/namei.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/namei.c b/fs/namei.c index dea2dabc62c1..c8b13a92bf69 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -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: |