diff options
| author | Jaegeuk Kim <jaegeuk@kernel.org> | 2016-04-12 16:05:36 -0700 |
|---|---|---|
| committer | Mister Oyster <oysterized@gmail.com> | 2017-04-13 12:33:16 +0200 |
| commit | 96a8b98cfd0c7465363577d7168ff818c65e9f5f (patch) | |
| tree | b9d38dd5a52f00ff90f54dff4e4d865039bdaabc | |
| parent | 315e390cb754ca113b6d22eeeed74975d1c87814 (diff) | |
ext4/fscrypto: avoid RCU lookup in d_revalidate
As Al pointed, d_revalidate should return RCU lookup before using d_inode.
This was originally introduced by:
commit 34286d666230 ("fs: rcu-walk aware d_revalidate method").
Reported-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Cc: Theodore Ts'o <tytso@mit.edu>
Cc: stable <stable@vger.kernel.org>
Conflicts:
fs/ext4/crypto.c
| -rw-r--r-- | fs/crypto/crypto.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/crypto/crypto.c b/fs/crypto/crypto.c index 44f8a87e3..af40768d7 100644 --- a/fs/crypto/crypto.c +++ b/fs/crypto/crypto.c @@ -28,6 +28,7 @@ #include <linux/ratelimit.h> #include <linux/bio.h> #include <linux/dcache.h> +#include <linux/namei.h> #include <linux/fscrypto.h> static unsigned int num_prealloc_crypto_pages = 32; @@ -352,6 +353,9 @@ static int fscrypt_d_revalidate(struct dentry *dentry, unsigned int flags) struct fscrypt_info *ci; int dir_has_key, cached_with_key; + if (flags & LOOKUP_RCU) + return -ECHILD; + dir = dget_parent(dentry); if (!dir->d_inode->i_sb->s_cop->is_encrypted(dir->d_inode)) { dput(dir); |
