kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Herbert Xu <herbert@gondor.apana.org.au>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Boris Brezillon <bbrezillon@kernel.org>,
	SrujanaChalla <schalla@marvell.com>,
	Arnaud Ebalard <arno@natisbad.org>,
	"David S. Miller" <davem@davemloft.net>,
	Lukasz Bartosik <lbartosik@marvell.com>,
	linux-crypto@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] crypto: marvell/octeontx - Fix a potential NULL dereference
Date: Fri, 12 Jun 2020 06:48:40 +0000	[thread overview]
Message-ID: <20200612064840.GE16987@gondor.apana.org.au> (raw)
In-Reply-To: <20200605110339.GE978434@mwanda>

On Fri, Jun 05, 2020 at 02:03:39PM +0300, Dan Carpenter wrote:
> Smatch reports that:
> 
>     drivers/crypto/marvell/octeontx/otx_cptvf_algs.c:132 otx_cpt_aead_callback()
>     warn: variable dereferenced before check 'cpt_info' (see line 121)
> 
> This function is called from process_pending_queue() as:
> 
> drivers/crypto/marvell/octeontx/otx_cptvf_reqmgr.c
>    599                  /*
>    600                   * Call callback after current pending entry has been
>    601                   * processed, we don't do it if the callback pointer is
>    602                   * invalid.
>    603                   */
>    604                  if (callback)
>    605                          callback(res_code, areq, cpt_info);
> 
> It does appear to me that "cpt_info" can be NULL so this could lead to
> a NULL dereference.
> 
> Fixes: 10b4f09491bf ("crypto: marvell - add the Virtual Function driver for CPT")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
>  drivers/crypto/marvell/octeontx/otx_cptvf_algs.c | 11 +++++++----
>  1 file changed, 7 insertions(+), 4 deletions(-)

Patch applied.  Thanks.
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

      reply	other threads:[~2020-06-12  6:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-05 11:03 [PATCH] crypto: marvell/octeontx - Fix a potential NULL dereference Dan Carpenter
2020-06-12  6:48 ` Herbert Xu [this message]

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=20200612064840.GE16987@gondor.apana.org.au \
    --to=herbert@gondor.apana.org.au \
    --cc=arno@natisbad.org \
    --cc=bbrezillon@kernel.org \
    --cc=dan.carpenter@oracle.com \
    --cc=davem@davemloft.net \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=lbartosik@marvell.com \
    --cc=linux-crypto@vger.kernel.org \
    --cc=schalla@marvell.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;
as well as URLs for NNTP newsgroup(s).