Skip to contentSkip to conversation

nfsd: reorder printk in do_probe_callback to avoid use-after-free

PATCH New J. Bruce Fields 1 participant 1 message May 6, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nfsd: reorder printk in do_probe_callback to avoid use-after-free

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

We're currently dereferencing the client after we drop our reference count to it.

---
 fs/nfsd/nfs4callback.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

I intend to submit this for 2.6.26.

--b.

fs/nfsd/nfs4callback.c +1 -1
index 562abf3..fadf423 100644
@@ -419,9 +419,9 @@ static int do_probe_callback(void *data)
 out_release_client:
 	rpc_shutdown_client(client);
 out_err:
-	put_nfs4_client(clp);
 	dprintk("NFSD: warning: no callback path to client %.*s\n",
 		(int)clp->cl_name.len, clp->cl_name.data);
+	put_nfs4_client(clp);
 	return status;
 }
 
Signature · 1 line
1.5.5.rc1