Skip to content

Commit

Permalink
may_follow_link() should use nd->inode
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Al Viro <[email protected]>
  • Loading branch information
Al Viro committed Aug 5, 2015
1 parent 97242f9 commit aa65fa3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit aa65fa3

Please sign in to comment.