Skip to contentSkip to conversation

NFSD: callback request does not use correct credential for AUTH_SYS

PATCH In review Dai Ngo 4 participants 4 messages Apr 1, 2023 – Apr 4, 2023

Subsystems (2)
lore
Share & tools
lore

Dai Ngo

author reviewer
#0 lore raw

PATCH 1/1 NFSD: callback request does not use correct credential for AUTH_SYS

Currently callback request does not use the credential specified in CREATE_SESSION if the security flavor for the back channel is AUTH_SYS.

Problem was discovered by pynfs 4.1 DELEG5 and DELEG7 test with error:
DELEG5 st_delegation.testCBSecParms : FAILURE

           expected callback with uid, gid == 17, 19, got 0, 0
---
 fs/nfsd/nfs4callback.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
fs/nfsd/nfs4callback.c +2 -2
index 2a815f5a52c4..4039ffcf90ba 100644
@@ -946,8 +946,8 @@ static const struct cred *get_backchannel_cred(struct nfs4_client *clp, struct r
 		if (!kcred)
 			return NULL;
 
-		kcred->uid = ses->se_cb_sec.uid;
-		kcred->gid = ses->se_cb_sec.gid;
+		kcred->fsuid = ses->se_cb_sec.uid;
+		kcred->fsgid = ses->se_cb_sec.gid;
 		return kcred;
 	}
 }
Signature · 1 line
2.9.5
#1 lore raw
Quoted 12 lines · Dai Ngo

Currently callback request does not use the credential specified in CREATE_SESSION if the security flavor for the back channel is AUTH_SYS.

Problem was discovered by pynfs 4.1 DELEG5 and DELEG7 test with error:
DELEG5 st_delegation.testCBSecParms : FAILURE

          expected callback with uid, gid == 17, 19, got 0, 0

Does

Fixes 8276c902bbe9 ("SUNRPC: remove uid and gid from struct auth_cred")

sound OK to everyone?

Quoted 22 lines

---
fs/nfsd/nfs4callback.c | 4 ++--

1 file changed, 2 insertions(+), 2 deletions(-)
fs/nfsd/nfs4callback.c +2 -2
index 2a815f5a52c4..4039ffcf90ba 100644
@@ -946,8 +946,8 @@ static const struct cred *get_backchannel_cred(struct nfs4_client *clp, struct r
 if (!kcred)
 return NULL;
 
- kcred->uid = ses->se_cb_sec.uid;
- kcred->gid = ses->se_cb_sec.gid;
+ kcred->fsuid = ses->se_cb_sec.uid;
+ kcred->fsgid = ses->se_cb_sec.gid;
 return kcred;
 }
 }
Signature · 1 line
2.9.5

--
Chuck Lever

#2 lore raw
Quoted 10 lines · Chuck Lever III
Quoted 10 lines · Dai Ngo

Currently callback request does not use the credential specified in CREATE_SESSION if the security flavor for the back channel is AUTH_SYS.

Problem was discovered by pynfs 4.1 DELEG5 and DELEG7 test with error:
DELEG5 st_delegation.testCBSecParms : FAILURE

          expected callback with uid, gid == 17, 19, got 0, 0
Quoted 7 lines
Quoted 1 line

Does

Fixes 8276c902bbe9 ("SUNRPC: remove uid and gid from struct auth_cred")

sound OK to everyone?

Yes, that looks right to me. Thanks.

NeilBrown

Quoted 30 lines
Quoted 24 lines

---
fs/nfsd/nfs4callback.c | 4 ++--

1 file changed, 2 insertions(+), 2 deletions(-)
fs/nfsd/nfs4callback.c +2 -2
index 2a815f5a52c4..4039ffcf90ba 100644
@@ -946,8 +946,8 @@ static const struct cred *get_backchannel_cred(struct nfs4_client *clp, struct r
 if (!kcred)
 return NULL;
 
- kcred->uid = ses->se_cb_sec.uid;
- kcred->gid = ses->se_cb_sec.gid;
+ kcred->fsuid = ses->se_cb_sec.uid;
+ kcred->fsgid = ses->se_cb_sec.gid;
 return kcred;
 }
 }
Signature · 1 line
2.9.5

--
Chuck Lever

maintainer Reviewed-by on v1 1/1
#3 lore raw
In reply to Dai Ngo
Quoted 17 lines · Dai Ngo

Currently callback request does not use the credential specified in CREATE_SESSION if the security flavor for the back channel is AUTH_SYS.

Problem was discovered by pynfs 4.1 DELEG5 and DELEG7 test with error:
DELEG5 st_delegation.testCBSecParms : FAILURE

           expected callback with uid, gid == 17, 19, got 0, 0
---
 fs/nfsd/nfs4callback.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
fs/nfsd/nfs4callback.c +0 -0
index 2a815f5a52c4..4039ffcf90ba 100644

fs/nfsd/nfs4callback.c static const struct cred *get_backchannel_cred(struct nfs4_client *clp, struct r · line 953

Quoted 10 lines
fs/nfsd/nfs4callback.c +2 -2
@@ -946,8 +946,8 @@ static const struct cred *get_backchannel_cred(struct nfs4_client *clp, struct r
 		if (!kcred)
 			return NULL;
 
-		kcred->uid = ses->se_cb_sec.uid;
-		kcred->gid = ses->se_cb_sec.gid;
+		kcred->fsuid = ses->se_cb_sec.uid;
+		kcred->fsgid = ses->se_cb_sec.gid;
 		return kcred;
 	}
 }