summaryrefslogtreecommitdiff
path: root/fs/namei.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2015-08-04 23:23:50 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2015-08-04 23:23:50 -0400
commitaa65fa35ba6b589a12a6025739c2d935dd743b5a (patch)
tree08badbdb13e71dfd4a60d1bb4545f115ec2277b7 /fs/namei.c
parent97242f99a013950af63effa0732f8ef7db4e31ec (diff)
downloadlinux-rpi3-aa65fa35ba6b589a12a6025739c2d935dd743b5a.tar.gz
linux-rpi3-aa65fa35ba6b589a12a6025739c2d935dd743b5a.tar.bz2
linux-rpi3-aa65fa35ba6b589a12a6025739c2d935dd743b5a.zip
may_follow_link() should use nd->inode
Now that we can get there in RCU mode, we shouldn't play with nd->path.dentry->d_inode - it's not guaranteed to be stable. Use nd->inode instead. Reported-by: Hugh Dickins <hughd@google.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/namei.c')
-rw-r--r--fs/namei.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/namei.c b/fs/namei.c
index fbbcf0993312..1c2105ed20c5 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -879,7 +879,7 @@ static inline int may_follow_link(struct nameidata *nd)
return 0;
/* Allowed if parent directory not sticky and world-writable. */
- parent = nd->path.dentry->d_inode;
+ parent = nd->inode;
if ((parent->i_mode & (S_ISVTX|S_IWOTH)) != (S_ISVTX|S_IWOTH))
return 0;