Skip to contentSkip to conversation

Patch "nfsd: fix deadlock secinfo+readdir compound" has been added to the 4.4-stable tree

PATCH [email protected] 1 participant 1 message Apr 10, 2016

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

nfsd: fix deadlock secinfo+readdir compound

to the 4.4-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:
nfsd-fix-deadlock-secinfo-readdir-compound.patch
and it can be found in the queue-4.4 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 2f6fc056e899bd0144a08da5cacaecbe8997cd74 Mon Sep 17 00:00:00 2001

From: "J. Bruce Fields" <[email protected]>
Date: Wed, 2 Mar 2016 16:36:21 -0800
Subject: nfsd: fix deadlock secinfo+readdir compound

From: J. Bruce Fields <[email protected]>

commit 2f6fc056e899bd0144a08da5cacaecbe8997cd74 upstream.

nfsd_lookup_dentry exits with the parent filehandle locked. fh_put also unlocks if necessary (nfsd filehandle locking is probably too lenient), so it gets unlocked eventually, but if the following op in the compound needs to lock it again, we can deadlock.

A fuzzer ran into this; normal clients don't send a secinfo followed by a readdir in the same compound.

---
 fs/nfsd/nfs4proc.c |    1 +
 1 file changed, 1 insertion(+)
fs/nfsd/nfs4proc.c +1 -0
@@ -877,6 +877,7 @@ nfsd4_secinfo(struct svc_rqst *rqstp, st
 				    &exp, &dentry);
 	if (err)
 		return err;
+	fh_unlock(&cstate->current_fh);
 	if (d_really_is_negative(dentry)) {
 		exp_put(exp);
 		err = nfserr_noent;

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

queue-4.4/nfsd-fix-deadlock-secinfo-readdir-compound.patch queue-4.4/nfsd4-fix-bad-bounds-checking.patch