Skip to contentSkip to conversation

Patch "NFSv4: Fix an rcu lock leak" has been added to the 4.11-stable tree

PATCH [email protected] 1 participant 1 message May 23, 2017

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

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

NFSv4: Fix an rcu lock leak

to the 4.11-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:
nfsv4-fix-an-rcu-lock-leak.patch
and it can be found in the queue-4.11 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From 2e84611b3f4fa50e1f4c12f2966fcc7fb955d944 Mon Sep 17 00:00:00 2001

From: Trond Myklebust <[email protected]>
Date: Fri, 5 May 2017 13:02:42 -0400
Subject: NFSv4: Fix an rcu lock leak

From: Trond Myklebust <[email protected]>

commit 2e84611b3f4fa50e1f4c12f2966fcc7fb955d944 upstream.

The intention in the original patch was to release the lock when we put the inode, however something got screwed up.

Fixes 7b410d9ce460f ("pNFS: Delay getting the layout header in..")
---
 fs/nfs/callback_proc.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
fs/nfs/callback_proc.c +4 -2
@@ -131,10 +131,11 @@ restart:
 			if (!inode)
 				continue;
 			if (!nfs_sb_active(inode->i_sb)) {
-				rcu_read_lock();
+				rcu_read_unlock();
 				spin_unlock(&clp->cl_lock);
 				iput(inode);
 				spin_lock(&clp->cl_lock);
+				rcu_read_lock();
 				goto restart;
 			}
 			return inode;
@@ -170,10 +171,11 @@ restart:
 			if (!inode)
 				continue;
 			if (!nfs_sb_active(inode->i_sb)) {
-				rcu_read_lock();
+				rcu_read_unlock();
 				spin_unlock(&clp->cl_lock);
 				iput(inode);
 				spin_lock(&clp->cl_lock);
+				rcu_read_lock();
 				goto restart;
 			}
 			return inode;

Patches currently in stable-queue which might be from [email protected] are

queue-4.11/nfs-use-gfp_noio-for-two-allocations-in-writeback.patch queue-4.11/nfsv4-fix-an-rcu-lock-leak.patch queue-4.11/nfsv4-fix-a-hang-in-open-related-to-server-reboot.patch queue-4.11/nfsd-fix-up-the-supattr_exclcreat-attributes.patch queue-4.11/pnfs-flexfiles-check-the-result-of-nfs4_pnfs_ds_connect.patch queue-4.11/nfs-fix-use-after-free-in-write-error-path.patch