public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] SUNRPC: Fix a credential refcount leak
@ 2019-06-20 14:47 Trond Myklebust
  2019-06-20 15:35 ` Ido Schimmel
  0 siblings, 1 reply; 2+ messages in thread
From: Trond Myklebust @ 2019-06-20 14:47 UTC (permalink / raw)
  To: Anna Schumaker; +Cc: Ido Schimmel, linux-nfs

All callers of __rpc_clone_client() pass in a value for args->cred,
meaning that the credential gets assigned and referenced in
the call to rpc_new_client().

Reported-by: Ido Schimmel <idosch@idosch.org>
Fixes: 79caa5fad47c ("SUNRPC: Cache cred of process creating the rpc_client")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
---
 net/sunrpc/clnt.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
index 627a87a71f8b..010e59cf2ae0 100644
--- a/net/sunrpc/clnt.c
+++ b/net/sunrpc/clnt.c
@@ -634,7 +634,6 @@ static struct rpc_clnt *__rpc_clone_client(struct rpc_create_args *args,
 	new->cl_discrtry = clnt->cl_discrtry;
 	new->cl_chatty = clnt->cl_chatty;
 	new->cl_principal = clnt->cl_principal;
-	new->cl_cred = get_cred(clnt->cl_cred);
 	return new;
 
 out_err:
-- 
2.21.0


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

* Re: [PATCH] SUNRPC: Fix a credential refcount leak
  2019-06-20 14:47 [PATCH] SUNRPC: Fix a credential refcount leak Trond Myklebust
@ 2019-06-20 15:35 ` Ido Schimmel
  0 siblings, 0 replies; 2+ messages in thread
From: Ido Schimmel @ 2019-06-20 15:35 UTC (permalink / raw)
  To: Trond Myklebust; +Cc: Anna Schumaker, linux-nfs

On Thu, Jun 20, 2019 at 10:47:40AM -0400, Trond Myklebust wrote:
> All callers of __rpc_clone_client() pass in a value for args->cred,
> meaning that the credential gets assigned and referenced in
> the call to rpc_new_client().
> 
> Reported-by: Ido Schimmel <idosch@idosch.org>
> Fixes: 79caa5fad47c ("SUNRPC: Cache cred of process creating the rpc_client")
> Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>

Tested-by: Ido Schimmel <idosch@mellanox.com>

Thanks a lot!

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

end of thread, other threads:[~2019-06-20 15:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-06-20 14:47 [PATCH] SUNRPC: Fix a credential refcount leak Trond Myklebust
2019-06-20 15:35 ` Ido Schimmel

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