Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1392791 > unrolled thread

[PATCH 4.5 165/200] ext4/fscrypto: avoid RCU lookup in d_revalidate

Started byGreg Kroah-Hartman <gregkh@linuxfoundation.org>
First post2016-05-03 03:10 +0200
Last post2016-05-03 03:10 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 4.5 165/200] ext4/fscrypto: avoid RCU lookup in d_revalidate Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-05-03 03:10 +0200

#1392791 — [PATCH 4.5 165/200] ext4/fscrypto: avoid RCU lookup in d_revalidate

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2016-05-03 03:10 +0200
Subject[PATCH 4.5 165/200] ext4/fscrypto: avoid RCU lookup in d_revalidate
Message-ID<rux0E-6wF-71@gated-at.bofh.it>
4.5-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Jaegeuk Kim <jaegeuk@kernel.org>

commit 03a8bb0e53d9562276045bdfcf2b5de2e4cff5a1 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 fs/ext4/crypto.c |    4 ++++
 1 file changed, 4 insertions(+)

--- 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"
@@ -479,6 +480,9 @@ static int ext4_d_revalidate(struct dent
 	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);

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web