[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAFX2JfkosbUmY2QTcb4eDTRpZusNUEj_OR2TMx+munSfjr7oeQ@mail.gmail.com>
Date: Mon, 8 Jul 2024 16:08:54 -0400
From: Anna Schumaker <anna@...nel.org>
To: Chuck Lever <chuck.lever@...cle.com>
Cc: Trond Myklebust <trond.myklebust@...merspace.com>, cuigaosheng1@...wei.com,
jlayton@...nel.org, neilb@...e.de, kolga@...app.com, Dai.Ngo@...cle.com,
tom@...pey.com, davem@...emloft.net, edumazet@...gle.com, kuba@...nel.org,
pabeni@...hat.com, steved@...hat.com, kwc@...i.umich.edu,
linux-nfs@...r.kernel.org, netdev@...r.kernel.org
Subject: Re: [PATCH -next] gss_krb5: Fix the error handling path for crypto_sync_skcipher_setkey
On Mon, Jul 8, 2024 at 10:52 AM Chuck Lever <chuck.lever@...cle.com> wrote:
>
> 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@...wei.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?
Sure! That sounds good to me.
Anna
>
> --
> Chuck Lever
Powered by blists - more mailing lists