diff options
| author | Jaegeuk Kim <jaegeuk@kernel.org> | 2016-04-12 16:05:36 -0700 |
|---|---|---|
| committer | Moyster <oysterized@gmail.com> | 2017-07-21 12:37:03 +0200 |
| commit | 75f1366a6964d8699cffba50945ffc2a5936f995 (patch) | |
| tree | 4dfc0a3a16ca4c342ed9cfc76ab1b4a600a1a0e4 /fs | |
| parent | dcb1bbdc06e817785382c17277b011194d266674 (diff) | |
BACKPORT: 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>
Bug: 29001513
Bug: 37690053
(cherry picked from commit 03a8bb0e53d9562276045bdfcf2b5de2e4cff5a1)
Change-Id: Ib27314728babf4ccdb7b603ac99896b55cb7b9e0
Diffstat (limited to 'fs')
| -rw-r--r-- | fs/ext4/crypto.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/ext4/crypto.c b/fs/ext4/crypto.c index 2b4929393..a5ba775b2 100644 --- a/fs/ext4/crypto.c +++ b/fs/ext4/crypto.c @@ -34,6 +34,7 @@ #include <linux/random.h> #include <linux/scatterlist.h> #include <linux/spinlock_types.h> +#include <linux/namei.h> #include "ext4_extents.h" #include "xattr.h" @@ -485,6 +486,9 @@ static int ext4_d_revalidate(struct dentry *dentry, unsigned int flags) struct ext4_crypt_info *ci; int dir_has_key, cached_with_key; + if (flags & LOOKUP_RCU) + return -ECHILD; + dir = dget_parent(dentry); if (!ext4_encrypted_inode(d_inode(dir))) { dput(dir); |
