Linux NFS development
 help / color / mirror / Atom feed
* [PATCH] NFSD: callback request does not use correct credential for AUTH_SYS
@ 2023-04-01 20:22 Dai Ngo
  2023-04-02 15:09 ` Chuck Lever III
  2023-04-04 10:54 ` Jeff Layton
  0 siblings, 2 replies; 4+ messages in thread
From: Dai Ngo @ 2023-04-01 20:22 UTC (permalink / raw)
  To: chuck.lever; +Cc: linux-nfs

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

Signed-off-by: Dai Ngo <dai.ngo@oracle.com>
---
 fs/nfsd/nfs4callback.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c
index 2a815f5a52c4..4039ffcf90ba 100644
--- a/fs/nfsd/nfs4callback.c
+++ b/fs/nfsd/nfs4callback.c
@@ -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;
 	}
 }
-- 
2.9.5


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] NFSD: callback request does not use correct credential for AUTH_SYS
  2023-04-01 20:22 [PATCH] NFSD: callback request does not use correct credential for AUTH_SYS Dai Ngo
@ 2023-04-02 15:09 ` Chuck Lever III
  2023-04-02 23:53   ` NeilBrown
  2023-04-04 10:54 ` Jeff Layton
  1 sibling, 1 reply; 4+ messages in thread
From: Chuck Lever III @ 2023-04-02 15:09 UTC (permalink / raw)
  To: Dai Ngo, Neil Brown; +Cc: Linux NFS Mailing List



> On Apr 1, 2023, at 4:22 PM, Dai Ngo <dai.ngo@oracle.com> wrote:
> 
> 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
> 
> Signed-off-by: Dai Ngo <dai.ngo@oracle.com>

Does

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

sound OK to everyone?


> ---
> fs/nfsd/nfs4callback.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c
> index 2a815f5a52c4..4039ffcf90ba 100644
> --- a/fs/nfsd/nfs4callback.c
> +++ b/fs/nfsd/nfs4callback.c
> @@ -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;
> }
> }
> -- 
> 2.9.5
> 

--
Chuck Lever



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] NFSD: callback request does not use correct credential for AUTH_SYS
  2023-04-02 15:09 ` Chuck Lever III
@ 2023-04-02 23:53   ` NeilBrown
  0 siblings, 0 replies; 4+ messages in thread
From: NeilBrown @ 2023-04-02 23:53 UTC (permalink / raw)
  To: Chuck Lever III; +Cc: Dai Ngo, Linux NFS Mailing List

On Mon, 03 Apr 2023, Chuck Lever III wrote:
> 
> > On Apr 1, 2023, at 4:22 PM, Dai Ngo <dai.ngo@oracle.com> wrote:
> > 
> > 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
> > 
> > Signed-off-by: Dai Ngo <dai.ngo@oracle.com>
> 
> Does
> 
> Fixes: 8276c902bbe9 ("SUNRPC: remove uid and gid from struct auth_cred")
> 
> sound OK to everyone?

Yes, that looks right to me.  Thanks.

NeilBrown

> 
> 
> > ---
> > fs/nfsd/nfs4callback.c | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c
> > index 2a815f5a52c4..4039ffcf90ba 100644
> > --- a/fs/nfsd/nfs4callback.c
> > +++ b/fs/nfsd/nfs4callback.c
> > @@ -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;
> > }
> > }
> > -- 
> > 2.9.5
> > 
> 
> --
> Chuck Lever
> 
> 
> 


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] NFSD: callback request does not use correct credential for AUTH_SYS
  2023-04-01 20:22 [PATCH] NFSD: callback request does not use correct credential for AUTH_SYS Dai Ngo
  2023-04-02 15:09 ` Chuck Lever III
@ 2023-04-04 10:54 ` Jeff Layton
  1 sibling, 0 replies; 4+ messages in thread
From: Jeff Layton @ 2023-04-04 10:54 UTC (permalink / raw)
  To: Dai Ngo, chuck.lever; +Cc: linux-nfs

On Sat, 2023-04-01 at 13:22 -0700, Dai Ngo wrote:
> 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
> 
> Signed-off-by: Dai Ngo <dai.ngo@oracle.com>
> ---
>  fs/nfsd/nfs4callback.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c
> index 2a815f5a52c4..4039ffcf90ba 100644
> --- a/fs/nfsd/nfs4callback.c
> +++ b/fs/nfsd/nfs4callback.c
> @@ -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;
>  	}
>  }

Reviewed-by: Jeff Layton <jlayton@kernel.org>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-04-04 10:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-01 20:22 [PATCH] NFSD: callback request does not use correct credential for AUTH_SYS Dai Ngo
2023-04-02 15:09 ` Chuck Lever III
2023-04-02 23:53   ` NeilBrown
2023-04-04 10:54 ` Jeff Layton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox