stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Patch "ext4/fscrypto: avoid RCU lookup in d_revalidate" has been added to the 4.5-stable tree
@ 2016-05-02 22:00 gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2016-05-02 22:00 UTC (permalink / raw)
  To: jaegeuk, gregkh, tytso, viro; +Cc: stable, stable-commits


This is a note to let you know that I've just added the patch titled

    ext4/fscrypto: avoid RCU lookup in d_revalidate

to the 4.5-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     ext4-fscrypto-avoid-rcu-lookup-in-d_revalidate.patch
and it can be found in the queue-4.5 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


>From 03a8bb0e53d9562276045bdfcf2b5de2e4cff5a1 Mon Sep 17 00:00:00 2001
From: Jaegeuk Kim <jaegeuk@kernel.org>
Date: Tue, 12 Apr 2016 16:05:36 -0700
Subject: ext4/fscrypto: avoid RCU lookup in d_revalidate

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);


Patches currently in stable-queue which might be from jaegeuk@kernel.org are

queue-4.5/f2fs-cover-large-section-in-sanity-check-of-super.patch
queue-4.5/f2fs-slightly-reorganize-read_raw_super_block.patch
queue-4.5/f2fs-do-f2fs_balance_fs-when-block-is-allocated.patch
queue-4.5/f2fs-don-t-need-to-call-set_page_dirty-for-io-error.patch
queue-4.5/f2fs-crypto-handle-unexpected-lack-of-encryption-keys.patch
queue-4.5/f2fs-crypto-fix-corrupted-symlink-in-encrypted-case.patch
queue-4.5/f2fs-crypto-make-sure-the-encryption-info-is-initialized-on-opendir-2.patch
queue-4.5/ext4-fscrypto-avoid-rcu-lookup-in-d_revalidate.patch

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-05-02 22:01 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-02 22:00 Patch "ext4/fscrypto: avoid RCU lookup in d_revalidate" has been added to the 4.5-stable tree gregkh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).