projects/linux·commit a3ca013d

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs

a3ca013d · Linus Torvalds <[email protected]> · 2015-08-10 10:04:47 -07:00

Pull RCU pathwalk fix from Al Viro:
 "Another racy use of nd->path.dentry in RCU mode"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
  may_follow_link() should use nd->inode
Commit
a3ca013d8824e9bcf9cd62111058e882be9b334c
Parents
f7644cbf · aa65fa35

Merge commit. Changes below are compared with the first parent: f7644cbf.

Changes

1 files changed · +1 −1

FileStatusAddDelContent
fs/namei.cmodified+1−1View file

fs/namei.c

View file
diff --git a/fs/namei.c b/fs/namei.c
index fbbcf09..1c2105e 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;