Эх сурвалжийг харах

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>
Al Viro 10 жил өмнө
parent
commit
aa65fa35ba
1 өөрчлөгдсөн 1 нэмэгдсэн , 1 устгасан
  1. 1 1
      fs/namei.c

+ 1 - 1
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;