diff options
author | J. Bruce Fields <bfields@redhat.com> | 2013-03-08 15:30:43 +0100 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2013-04-03 17:48:32 +0200 |
commit | 2e4b7239a62a0c58664bf0cf73aea951b7e046fc (patch) | |
tree | d8db12040e66611836a47b9851c53ee72250d335 /fs/nfsd/nfs4state.c | |
parent | nfsd4: fix race on client shutdown (diff) | |
download | linux-2e4b7239a62a0c58664bf0cf73aea951b7e046fc.tar.xz linux-2e4b7239a62a0c58664bf0cf73aea951b7e046fc.zip |
nfsd4: fix use-after-free of 4.1 client on connection loss
Once we drop the lock here there's nothing keeping the client around:
the only lock still held is the xpt_lock on this socket, but this socket
no longer has any connection with the client so there's no way for other
code to know we're still using the client.
The solution is simple: all nfsd4_probe_callback does is set a few
variables and queue some work, so there's no reason we can't just keep
it under the lock.
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd/nfs4state.c')
-rw-r--r-- | fs/nfsd/nfs4state.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index 3e5cbfe8a967..baf314a950b8 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -761,8 +761,8 @@ static void nfsd4_conn_lost(struct svc_xpt_user *u) list_del(&c->cn_persession); free_conn(c); } - spin_unlock(&clp->cl_lock); nfsd4_probe_callback(clp); + spin_unlock(&clp->cl_lock); } static struct nfsd4_conn *alloc_conn(struct svc_rqst *rqstp, u32 flags) |