This is a note to let you know that I've just added the patch titled vfs: fix race in rcu lookup of pruned dentry
to the 2.6.39-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: vfs-fix-race-in-rcu-lookup-of-pruned-dentry.patch and it can be found in the queue-2.6.39 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <sta...@kernel.org> know about it. >From hu...@google.com Mon Aug 1 11:55:24 2011 From: Hugh Dickins <hu...@google.com> Date: Tue, 26 Jul 2011 13:04:16 -0700 (PDT) Subject: vfs: fix race in rcu lookup of pruned dentry To: Stable Kernel <sta...@kernel.org> Cc: Mike Waychison <mi...@google.com>, Linus Torvalds <torva...@linux-foundation.org>, Al Viro <v...@zeniv.linux.org.uk>, Ian Kent <ra...@themaw.net> Message-ID: <alpine.LSU.2.00.1107261239110.24976@sister.anvils> From: Linus Torvalds <torva...@linux-foundation.org> Backport of commit 59430262401bec02d415179c43dbe5b8819c09ce done by Hugh Dickins <hu...@google.com> Don't update *inode in __follow_mount_rcu() until we'd verified that there is mountpoint there. Kudos to Hugh Dickins for catching that one in the first place and eventually figuring out the solution (and catching a braino in the earlier version of patch). Signed-off-by: Linus Torvalds <torva...@linux-foundation.org> Cc: Hugh Dickins <hu...@google.com> Signed-off-by: Al Viro <v...@zeniv.linux.org.uk> --- fs/namei.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) --- a/fs/namei.c +++ b/fs/namei.c @@ -1013,7 +1013,6 @@ static bool __follow_mount_rcu(struct na * Don't forget we might have a non-mountpoint managed dentry * that wants to block transit. */ - *inode = path->dentry->d_inode; if (!reverse_transit && unlikely(managed_dentry_might_block(path->dentry))) return false; @@ -1027,6 +1026,12 @@ static bool __follow_mount_rcu(struct na path->mnt = mounted; path->dentry = mounted->mnt_root; nd->seq = read_seqcount_begin(&path->dentry->d_seq); + /* + * Update the inode too. We don't need to re-check the + * dentry sequence number here after this d_inode read, + * because a mount-point is always pinned. + */ + *inode = path->dentry->d_inode; } if (unlikely(path->dentry->d_flags & DCACHE_NEED_AUTOMOUNT)) Patches currently in stable-queue which might be from hu...@google.com are queue-2.6.39/vfs-fix-race-in-rcu-lookup-of-pruned-dentry.patch _______________________________________________ stable mailing list stable@linux.kernel.org http://linux.kernel.org/mailman/listinfo/stable