linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <error27@gmail.com>
To: oe-kbuild@lists.linux.dev, 'Guanjun' <guanjun@linux.alibaba.com>,
	herbert@gondor.apana.org.au, elliott@hpe.com
Cc: lkp@intel.com, oe-kbuild-all@lists.linux.dev,
	zelin.deng@linux.alibaba.com, artie.ding@linux.alibaba.com,
	guanjun@linux.alibaba.com, linux-crypto@vger.kernel.org,
	linux-kernel@vger.kernel.org, xuchun.shang@linux.alibaba.com
Subject: Re: [PATCH v3 RESEND 8/9] crypto/ycc: Add sm2 algorithm support
Date: Mon, 7 Nov 2022 11:01:30 +0300	[thread overview]
Message-ID: <202211060420.IwtCMD76-lkp@intel.com> (raw)
In-Reply-To: <1667461243-48652-9-git-send-email-guanjun@linux.alibaba.com>

Hi 'Guanjun',

https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Guanjun/Drivers-for-Alibaba-YCC-Yitian-Cryptography-Complex-cryptographic-accelerator/20221103-154448
base:   https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git master
patch link:    https://lore.kernel.org/r/1667461243-48652-9-git-send-email-guanjun%40linux.alibaba.com
patch subject: [PATCH v3 RESEND 8/9] crypto/ycc: Add sm2 algorithm support
config: ia64-randconfig-m031-20221104
compiler: ia64-linux-gcc (GCC) 12.1.0

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Reported-by: Dan Carpenter <error27@gmail.com>

smatch warnings:
drivers/crypto/ycc/ycc_pke.c:880 ycc_sm2_exit() warn: variable dereferenced before check 'ctx->ring' (see line 878)

vim +880 drivers/crypto/ycc/ycc_pke.c

eb2973011f26b6 Xuchun Shang 2022-11-03  875  static void ycc_sm2_exit(struct crypto_akcipher *tfm)
eb2973011f26b6 Xuchun Shang 2022-11-03  876  {
eb2973011f26b6 Xuchun Shang 2022-11-03  877  	struct ycc_pke_ctx *ctx = akcipher_tfm_ctx(tfm);
eb2973011f26b6 Xuchun Shang 2022-11-03 @878  	struct device *dev = YCC_DEV(ctx);

ctx->ring dereferenced inside YCC_DEV() (says the checker).

eb2973011f26b6 Xuchun Shang 2022-11-03  879  
eb2973011f26b6 Xuchun Shang 2022-11-03 @880  	if (ctx->ring)
                                                    ^^^^^^^^^
Checked too late.

eb2973011f26b6 Xuchun Shang 2022-11-03  881  		ycc_crypto_free_ring(ctx->ring);
eb2973011f26b6 Xuchun Shang 2022-11-03  882  
eb2973011f26b6 Xuchun Shang 2022-11-03  883  	if (ctx->pub_key_vaddr)
eb2973011f26b6 Xuchun Shang 2022-11-03  884  		dma_free_coherent(dev, 64, ctx->pub_key_vaddr, ctx->pub_key_paddr);
eb2973011f26b6 Xuchun Shang 2022-11-03  885  
eb2973011f26b6 Xuchun Shang 2022-11-03  886  	crypto_free_akcipher(ctx->soft_tfm);
eb2973011f26b6 Xuchun Shang 2022-11-03  887  }

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp


  reply	other threads:[~2022-11-07  8:01 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-03  7:40 [PATCH v3 RESEND 0/9] Drivers for Alibaba YCC (Yitian Cryptography Complex) cryptographic accelerator 'Guanjun'
2022-11-03  7:40 ` [PATCH v3 RESEND 1/9] crypto/ycc: Add YCC (Yitian Cryptography Complex) accelerator driver 'Guanjun'
2022-11-03  7:40 ` [PATCH v3 RESEND 2/9] crypto/ycc: Add ycc ring configuration 'Guanjun'
2022-11-07  7:46   ` Dan Carpenter
2022-11-07 13:28   ` kernel test robot
2022-11-09 20:25   ` kernel test robot
2022-11-03  7:40 ` [PATCH v3 RESEND 3/9] crypto/ycc: Add irq support for ycc kernel rings 'Guanjun'
2022-11-07  7:50   ` Dan Carpenter
2022-11-10  1:28   ` kernel test robot
2022-11-03  7:40 ` [PATCH v3 RESEND 4/9] crypto/ycc: Add device error handling support for ycc hw errors 'Guanjun'
2022-11-10  5:51   ` kernel test robot
2022-11-03  7:40 ` [PATCH v3 RESEND 5/9] crypto/ycc: Add skcipher algorithm support 'Guanjun'
2022-11-03  7:40 ` [PATCH v3 RESEND 6/9] crypto/ycc: Add aead " 'Guanjun'
2022-11-03  7:40 ` [PATCH v3 RESEND 7/9] crypto/ycc: Add rsa " 'Guanjun'
2022-11-03  7:40 ` [PATCH v3 RESEND 8/9] crypto/ycc: Add sm2 " 'Guanjun'
2022-11-07  8:01   ` Dan Carpenter [this message]
2022-11-03  7:40 ` [PATCH v3 RESEND 9/9] MAINTAINERS: Add Yitian Cryptography Complex (YCC) driver maintainer entry 'Guanjun'

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=202211060420.IwtCMD76-lkp@intel.com \
    --to=error27@gmail.com \
    --cc=artie.ding@linux.alibaba.com \
    --cc=elliott@hpe.com \
    --cc=guanjun@linux.alibaba.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=oe-kbuild@lists.linux.dev \
    --cc=xuchun.shang@linux.alibaba.com \
    --cc=zelin.deng@linux.alibaba.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).