Skip to content

Commit aa65fa3

Browse files
author
Al Viro
committed
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>
1 parent 97242f9 commit aa65fa3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/namei.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -879,7 +879,7 @@ static inline int may_follow_link(struct nameidata *nd)
879879
return 0;
880880

881881
/* Allowed if parent directory not sticky and world-writable. */
882-
parent = nd->path.dentry->d_inode;
882+
parent = nd->inode;
883883
if ((parent->i_mode & (S_ISVTX|S_IWOTH)) != (S_ISVTX|S_IWOTH))
884884
return 0;
885885

0 commit comments

Comments
 (0)