diff options
author | J. Bruce Fields <bfields@redhat.com> | 2016-09-21 03:55:36 +0300 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2016-09-26 22:20:38 +0300 |
commit | 7d22fc11c7edeeac6f1c3f1ae0edcef4de08c6e0 (patch) | |
tree | 51c6cdd75f7a6b424fc65cd8c72aec630c9746f5 /fs/nfsd | |
parent | ebd7c72c63acc3d00944c88cbf96143a8cae179f (diff) | |
download | linux-7d22fc11c7edeeac6f1c3f1ae0edcef4de08c6e0.tar.xz |
nfsd4: setclientid_confirm with unmatched verifier should fail
A setclientid_confirm with (clientid, verifier) both matching an
existing confirmed record is assumed to be a replay, but if the verifier
doesn't match, it shouldn't be.
This would be a very rare case, except that clients following
https://tools.ietf.org/html/rfc7931#section-5.8 may depend on the
failure.
Reviewed-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd')
-rw-r--r-- | fs/nfsd/nfs4state.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index 4062f4fbfc6d..a0e5128ec539 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -3304,9 +3304,10 @@ nfsd4_setclientid_confirm(struct svc_rqst *rqstp, goto out; /* cases below refer to rfc 3530 section 14.2.34: */ if (!unconf || !same_verf(&confirm, &unconf->cl_confirm)) { - if (conf && !unconf) /* case 2: probable retransmit */ + if (conf && same_verf(&confirm, &conf->cl_confirm)) { + /* case 2: probable retransmit */ status = nfs_ok; - else /* case 4: client hasn't noticed we rebooted yet? */ + } else /* case 4: client hasn't noticed we rebooted yet? */ status = nfserr_stale_clientid; goto out; } |