Linux NFS development
 help / color / mirror / Atom feed
From: Chuck Lever <chuck.lever@oracle.com>
To: Trond Myklebust <trond.myklebust@hammerspace.com>,
	Anna Schumaker <anna@kernel.org>
Cc: cuigaosheng1@huawei.com, jlayton@kernel.org, neilb@suse.de,
	kolga@netapp.com, Dai.Ngo@oracle.com, tom@talpey.com,
	davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
	pabeni@redhat.com, steved@redhat.com, kwc@citi.umich.edu,
	linux-nfs@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH -next] gss_krb5: Fix the error handling path for crypto_sync_skcipher_setkey
Date: Mon, 8 Jul 2024 10:51:56 -0400	[thread overview]
Message-ID: <Zov9DIiHSUGprMK8@tissot.1015granger.net> (raw)
In-Reply-To: <20240706065008.451441-1-cuigaosheng1@huawei.com>

On Sat, Jul 06, 2024 at 02:50:08PM +0800, Gaosheng Cui wrote:
> If we fail to call crypto_sync_skcipher_setkey, we should free the
> memory allocation for cipher, replace err_return with err_free_cipher
> to free the memory of cipher.
> 
> Fixes: 4891f2d008e4 ("gss_krb5: import functionality to derive keys into the kernel")
> Signed-off-by: Gaosheng Cui <cuigaosheng1@huawei.com>
> ---
>  net/sunrpc/auth_gss/gss_krb5_keys.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/sunrpc/auth_gss/gss_krb5_keys.c b/net/sunrpc/auth_gss/gss_krb5_keys.c
> index 06d8ee0db000..4eb19c3a54c7 100644
> --- a/net/sunrpc/auth_gss/gss_krb5_keys.c
> +++ b/net/sunrpc/auth_gss/gss_krb5_keys.c
> @@ -168,7 +168,7 @@ static int krb5_DK(const struct gss_krb5_enctype *gk5e,
>  		goto err_return;
>  	blocksize = crypto_sync_skcipher_blocksize(cipher);
>  	if (crypto_sync_skcipher_setkey(cipher, inkey->data, inkey->len))
> -		goto err_return;
> +		goto err_free_cipher;
>  
>  	ret = -ENOMEM;
>  	inblockdata = kmalloc(blocksize, gfp_mask);
> -- 
> 2.25.1
> 

Anna, Trond, would you like me to take this through the NFSD tree?

-- 
Chuck Lever

  parent reply	other threads:[~2024-07-08 14:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-06  6:50 [PATCH -next] gss_krb5: Fix the error handling path for crypto_sync_skcipher_setkey Gaosheng Cui
2024-07-08  9:10 ` Simon Horman
2024-07-08 14:51 ` Chuck Lever [this message]
2024-07-08 20:08   ` Anna Schumaker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Zov9DIiHSUGprMK8@tissot.1015granger.net \
    --to=chuck.lever@oracle.com \
    --cc=Dai.Ngo@oracle.com \
    --cc=anna@kernel.org \
    --cc=cuigaosheng1@huawei.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=jlayton@kernel.org \
    --cc=kolga@netapp.com \
    --cc=kuba@kernel.org \
    --cc=kwc@citi.umich.edu \
    --cc=linux-nfs@vger.kernel.org \
    --cc=neilb@suse.de \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=steved@redhat.com \
    --cc=tom@talpey.com \
    --cc=trond.myklebust@hammerspace.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox