For the case where an NFSv4.1 ExchangeID operation has the client identifier

that already has a confirmed ClientID, the nfsrv_setclient() function would
not fill in the clientidp being returned. As such, the value of ClientID
returned would be whatever garbage was on the stack.
An NFSv4.1 client would not normally do this, but it appears that it can
happen for certain Linux clients. When it happens, the client persistently
retries the ExchangeID and Create_session after Create_session fails when
it uses the bogus clientid. With this patch, the correct clientid is replied.
This problem was identified in a packet trace supplied by
Ahmed Kamal via email.

Reported by:	email.ahmedkamal@googlemail.com
MFC after:	2 weeks
This commit is contained in:
Rick Macklem 2015-08-14 22:02:14 +00:00
parent 58bbcdb183
commit 29dc40b6be
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=286790

View File

@ -401,9 +401,12 @@ nfsrv_setclient(struct nfsrv_descript *nd, struct nfsclient **new_clpp,
}
/* For NFSv4.1, mark that we found a confirmed clientid. */
if ((nd->nd_flag & ND_NFSV41) != 0)
if ((nd->nd_flag & ND_NFSV41) != 0) {
clientidp->lval[0] = clp->lc_clientid.lval[0];
clientidp->lval[1] = clp->lc_clientid.lval[1];
confirmp->lval[0] = 0; /* Ignored by client */
confirmp->lval[1] = 1;
else {
} else {
/*
* id and verifier match, so update the net address info
* and get rid of any existing callback authentication