From: Trond Myklebust Date: Thu, 20 Jun 2019 14:47:40 +0000 (-0400) Subject: SUNRPC: Fix a credential refcount leak X-Git-Tag: v5.2-rc6~8^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=19d55046cd824baab53534ba7e7f99945c6fdcb1;p=thirdparty%2Flinux.git SUNRPC: Fix a credential refcount leak 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 Fixes: 79caa5fad47c ("SUNRPC: Cache cred of process creating the rpc_client") Signed-off-by: Trond Myklebust Tested-by: Ido Schimmel Signed-off-by: Anna Schumaker --- diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c index 2b353472364fc..b03bfa055c082 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: