nfsd: nfsd4_setclientid_confirm mistakenly expires confirmed client.
Subsystems (2)
Dai Ngo
reviewerPATCH 1/1 nfsd: nfsd4_setclientid_confirm mistakenly expires confirmed client.
From RFC 7530 Section 16.34.5:
o The server has not recorded an unconfirmed { v, x, c, *, * } and has recorded a confirmed { v, x, c, *, s }. If the principals of the record and of SETCLIENTID_CONFIRM do not match, the server returns NFS4ERR_CLID_INUSE without removing any relevant leased client state, and without changing recorded callback and callback_ident values for client { x }.
The current code intents to do what the spec describes above but it forgot to set 'old' to NULL resulting to the confirmed client to be expired.
--- fs/nfsd/nfs4state.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
fs/nfsd/nfs4state.c +3 -1
@@ -4130,8 +4130,10 @@ nfsd4_setclientid_confirm(struct svc_rqst *rqstp, status = nfserr_clid_inuse;if (client_has_state (old) && !same_creds (&unconf->cl_cred, - &old->cl_cred)) + &old->cl_cred)) { + old =NULL ; goto out; + } status =mark_client_expired_locked (old);if (status) { old =NULL ;
Signature · 1 line
2.9.5
Hi Dai-
Quoted 11 lines · Dai Ngo
From RFC 7530 Section 16.34.5:
o The server has not recorded an unconfirmed { v, x, c, *, * } and has recorded a confirmed { v, x, c, *, s }. If the principals of the record and of
SETCLIENTID_CONFIRMdo not match, the server returnsNFS4ERR_CLID_INUSEwithout removing any relevant leased client state, and without changing recorded callback andcallback_identvalues for client { x }.
Quoted 5 lines
The current code intents to do what the spec describes above but it forgot to set 'old' to NULL resulting to the confirmed client to be expired.
Signed-off-by Dai Ngo <[email protected]>
On it's face, this seems like the correct thing to do.
I believe the issue was introduced in commit 2b63482185e6 ("nfsd:
fix clid_inuse on mount with security change") in 2015. I can add a Fixes: tag and apply this for 5.17-rc.
Quoted 23 lines
---
fs/nfsd/nfs4state.c| 4 +++-1 file changed, 3 insertions(+), 1 deletion(-)fs/nfsd/nfs4state.c +3
-1@@ -4130,8 +4130,10 @@ nfsd4_setclientid_confirm(struct svc_rqst *rqstp, status = nfserr_clid_inuse;if (client_has_state (old) && !same_creds (&unconf->cl_cred, - &old->cl_cred)) + &old->cl_cred)) { + old =NULL ; goto out; + } status =mark_client_expired_locked (old);if (status) { old =NULL ;Signature · 1 line
2.9.5
--
Chuck Lever
Quoted 17 lines · Chuck Lever III
Hi Dai-
Quoted 15 lines · Dai Ngo
From RFC 7530 Section 16.34.5:
o The server has not recorded an unconfirmed { v, x, c, *, * } and has recorded a confirmed { v, x, c, *, s }. If the principals of the record and of
SETCLIENTID_CONFIRMdo not match, the server returnsNFS4ERR_CLID_INUSEwithout removing any relevant leased client state, and without changing recorded callback andcallback_identvalues for client { x }.The current code intents to do what the spec describes above but it forgot to set 'old' to NULL resulting to the confirmed client to be expired.
Quoted 7 lines
Quoted 1 line
Signed-off-by Dai Ngo <[email protected]>On it's face, this seems like the correct thing to do.
I believe the issue was introduced in commit
2b63482185e6("nfsd:
fixclid_inuseon mount with security change") in 2015. I can add a Fixes: tag and apply this for 5.17-rc.
Looks right to me too--thanks, Dai.
--b.
Quoted 28 lines
Quoted 23 lines
---
fs/nfsd/nfs4state.c| 4 +++-1 file changed, 3 insertions(+), 1 deletion(-)fs/nfsd/nfs4state.c +3
-1@@ -4130,8 +4130,10 @@ nfsd4_setclientid_confirm(struct svc_rqst *rqstp, status = nfserr_clid_inuse;if (client_has_state (old) && !same_creds (&unconf->cl_cred, - &old->cl_cred)) + &old->cl_cred)) { + old =NULL ; goto out; + } status =mark_client_expired_locked (old);if (status) { old =NULL ;Signature · 1 line
2.9.5--
Chuck Lever
Quoted 24 lines · J. Bruce Fields
Quoted 19 lines · Chuck Lever III
Hi Dai-
Quoted 16 lines · Dai Ngo
From RFC 7530 Section 16.34.5:
o The server has not recorded an unconfirmed { v, x, c, *, * } and has recorded a confirmed { v, x, c, *, s }. If the principals of the record and of
SETCLIENTID_CONFIRMdo not match, the server returnsNFS4ERR_CLID_INUSEwithout removing any relevant leased client state, and without changing recorded callback andcallback_identvalues for client { x }.The current code intents to do what the spec describes above but it forgot to set 'old' to NULL resulting to the confirmed client to be expired.
Signed-off-by Dai Ngo <[email protected]>
Quoted 7 lines
Quoted 5 lines
On it's face, this seems like the correct thing to do.
I believe the issue was introduced in commit
2b63482185e6("nfsd:
fixclid_inuseon mount with security change") in 2015. I can add a Fixes: tag and apply this for 5.17-rc.Looks right to me too--thanks, Dai.
May I add a Reviewed-by: Bruce ?
Quoted 29 lines
--b.
Quoted 26 lines
Quoted 23 lines
---
fs/nfsd/nfs4state.c| 4 +++-1 file changed, 3 insertions(+), 1 deletion(-)fs/nfsd/nfs4state.c +3
-1@@ -4130,8 +4130,10 @@ nfsd4_setclientid_confirm(struct svc_rqst *rqstp, status = nfserr_clid_inuse;if (client_has_state (old) && !same_creds (&unconf->cl_cred, - &old->cl_cred)) + &old->cl_cred)) { + old =NULL ; goto out; + } status =mark_client_expired_locked (old);if (status) { old =NULL ;Signature · 1 line
2.9.5--
Chuck Lever
--
Chuck Lever
Quoted 26 lines · Chuck Lever III
Quoted 26 lines · J. Bruce Fields
Quoted 21 lines · Chuck Lever III
Hi Dai-
Quoted 11 lines · Dai Ngo
From RFC 7530 Section 16.34.5:
o The server has not recorded an unconfirmed { v, x, c, *, * } and has recorded a confirmed { v, x, c, *, s }. If the principals of the record and of
SETCLIENTID_CONFIRMdo not match, the server returnsNFS4ERR_CLID_INUSEwithout removing any relevant leased client state, and without changing recorded callback andcallback_identvalues for client { x }.Quoted 5 lines
The current code intents to do what the spec describes above but it forgot to set 'old' to NULL resulting to the confirmed client to be expired.
Signed-off-by Dai Ngo <[email protected]>On it's face, this seems like the correct thing to do.
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
I believe the issue was introduced in commit
2b63482185e6("nfsd:
fixclid_inuseon mount with security change") in 2015. I can add a Fixes: tag and apply this for 5.17-rc.Looks right to me too--thanks, Dai.
May I add a Reviewed-by: Bruce ?
Sure.--b.