be careful with nd->inode in path_init() and follow_dotdot_rcu()
authorAl Viro <viro@zeniv.linux.org.uk>
Sun, 14 Sep 2014 01:59:43 +0000 (21:59 -0400)
committerBen Hutchings <ben@decadent.org.uk>
Wed, 5 Nov 2014 20:27:43 +0000 (20:27 +0000)
commit1a4ba51a1d7def5f36b7dec2defd3c4ab27e9fb0
treeed22233fafabfe265119a4a33b5a529da8e12318
parenta7caf25487f8b0d85f0fa0eb9403301f2b35c1b1
be careful with nd->inode in path_init() and follow_dotdot_rcu()

commit 4023bfc9f351a7994fb6a7d515476c320f94a574 upstream.

in the former we simply check if dentry is still valid after picking
its ->d_inode; in the latter we fetch ->d_inode in the same places
where we fetch dentry and its ->d_seq, under the same checks.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
fs/namei.c