summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJ. Bruce Fields <bfields@redhat.com>2012-05-13 05:08:41 +0400
committerJ. Bruce Fields <bfields@redhat.com>2012-06-01 04:29:51 +0400
commitea236d0704b9b9e7742b107313bbdddbba62724a (patch)
tree7740b9f39781f7efeb052c35fdfd395a28e1c9c3
parent2786cc3a056e642809a348d9b1e6a857b9d23d25 (diff)
downloadlinux-ea236d0704b9b9e7742b107313bbdddbba62724a.tar.xz
nfsd4: exchange_id: check creds before killing confirmed client
We mustn't allow a client to destroy another client with established state unless it has the right credential. And some minor cleanup. (Note: our comparison of credentials is actually pretty bogus currently; that will need to be fixed in another patch.) Signed-off-by: J. Bruce Fields <bfields@redhat.com>
-rw-r--r--fs/nfsd/nfs4state.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index aca84c942595..f372a6edef34 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -1556,6 +1556,14 @@ nfsd4_exchange_id(struct svc_rqst *rqstp,
status = nfserr_clid_inuse; /* XXX: ? */
goto out;
}
+ if (!same_creds(&conf->cl_cred, &rqstp->rq_cred)) {
+ /* 18.35.4 case 9 */
+ if (exid->flags & EXCHGID4_FLAG_UPD_CONFIRMED_REC_A)
+ status = nfserr_perm;
+ else /* case 3 */
+ status = nfserr_clid_inuse;
+ goto out;
+ }
if (!same_verf(&verf, &conf->cl_verifier)) {
/* 18.35.4 case 8 */
if (exid->flags & EXCHGID4_FLAG_UPD_CONFIRMED_REC_A) {
@@ -1566,15 +1574,6 @@ nfsd4_exchange_id(struct svc_rqst *rqstp,
expire_client(conf);
goto out_new;
}
- if (!same_creds(&conf->cl_cred, &rqstp->rq_cred)) {
- /* 18.35.4 case 9 */
- if (exid->flags & EXCHGID4_FLAG_UPD_CONFIRMED_REC_A) {
- status = nfserr_perm;
- goto out;
- }
- expire_client(conf);
- goto out_new;
- }
/*
* Set bit when the owner id and verifier map to an already
* confirmed client id (18.35.3).