All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: Re: [PATCH 07/12] nvme: Implement In-Band authentication
Date: Sun, 21 Nov 2021 05:09:17 +0800	[thread overview]
Message-ID: <202111210541.MENoUt8o-lkp@intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 14710 bytes --]

CC: llvm(a)lists.linux.dev
CC: kbuild-all(a)lists.01.org
In-Reply-To: <20211112125928.97318-8-hare@suse.de>
References: <20211112125928.97318-8-hare@suse.de>
TO: Hannes Reinecke <hare@suse.de>

Hi Hannes,

I love your patch! Perhaps something to improve:

[auto build test WARNING on linus/master]
[also build test WARNING on v5.16-rc1 next-20211118]
[cannot apply to herbert-cryptodev-2.6/master herbert-crypto-2.6/master linux-nvme/for-next]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Hannes-Reinecke/nvme-In-band-authentication-support/20211112-210112
base:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 5833291ab6de9c3e2374336b51c814e515e8f3a5
:::::: branch date: 8 days ago
:::::: commit date: 8 days ago
config: riscv-randconfig-c006-20211118 (attached as .config)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install riscv cross compiling tool for clang build
        # apt-get install binutils-riscv64-linux-gnu
        # https://github.com/0day-ci/linux/commit/306a253f85fb90aad03f8a14436907c2d96f4d55
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Hannes-Reinecke/nvme-In-band-authentication-support/20211112-210112
        git checkout 306a253f85fb90aad03f8a14436907c2d96f4d55
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=riscv clang-analyzer 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>


clang-analyzer warnings: (new ones prefixed by >>)
   drivers/nvme/host/auth.c:929:8: note: Calling 'nvme_auth_dhchap_host_response'
           ret = nvme_auth_dhchap_host_response(ctrl, chap);
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/nvme/host/auth.c:659:2: note: Taking false branch
           dev_dbg(ctrl->device, "%s: qid %d host response seq %d transaction %d\n",
           ^
   include/linux/dev_printk.h:162:2: note: expanded from macro 'dev_dbg'
           if (0)                                                          \
           ^
   drivers/nvme/host/auth.c:662:13: note: Field 'host_response' is null
           if (!chap->host_response) {
                      ^
   drivers/nvme/host/auth.c:662:2: note: Taking true branch
           if (!chap->host_response) {
           ^
   drivers/nvme/host/auth.c:663:25: note: Calling 'nvme_auth_transform_key'
                   chap->host_response = nvme_auth_transform_key(ctrl->dhchap_key,
                                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/nvme/host/auth.c:249:26: note: Calling 'nvme_auth_hmac_name'
           const char *hmac_name = nvme_auth_hmac_name(key_hash);
                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/nvme/host/auth.c:146:2: note: Loop condition is true.  Entering loop body
           for (i = 0; i < ARRAY_SIZE(hash_map); i++) {
           ^
   drivers/nvme/host/auth.c:147:7: note: Assuming 'hmac_id' is equal to field 'id'
                   if (hash_map[i].id == hmac_id)
                       ^~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/nvme/host/auth.c:147:3: note: Taking true branch
                   if (hash_map[i].id == hmac_id)
                   ^
   drivers/nvme/host/auth.c:148:4: note: Returning pointer, which participates in a condition later
                           return hash_map[i].hmac;
                           ^~~~~~~~~~~~~~~~~~~~~~~
   drivers/nvme/host/auth.c:249:26: note: Returning from 'nvme_auth_hmac_name'
           const char *hmac_name = nvme_auth_hmac_name(key_hash);
                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/nvme/host/auth.c:252:2: note: 'transformed_key' declared without an initial value
           u8 *transformed_key;
           ^~~~~~~~~~~~~~~~~~~
   drivers/nvme/host/auth.c:255:6: note: Assuming 'key_hash' is not equal to 0
           if (key_hash == 0) {
               ^~~~~~~~~~~~~
   drivers/nvme/host/auth.c:255:2: note: Taking false branch
           if (key_hash == 0) {
           ^
   drivers/nvme/host/auth.c:260:6: note: Assuming 'key' is non-null
           if (!key || !key_len) {
               ^~~~
   drivers/nvme/host/auth.c:260:6: note: Left side of '||' is false
   drivers/nvme/host/auth.c:260:14: note: Assuming 'key_len' is not equal to 0
           if (!key || !key_len) {
                       ^~~~~~~~
   drivers/nvme/host/auth.c:260:2: note: Taking false branch
           if (!key || !key_len) {
           ^
   drivers/nvme/host/auth.c:264:7: note: 'hmac_name' is non-null
           if (!hmac_name) {
                ^~~~~~~~~
   drivers/nvme/host/auth.c:264:2: note: Taking false branch
           if (!hmac_name) {
           ^
   drivers/nvme/host/auth.c:270:6: note: Calling 'IS_ERR'
           if (IS_ERR(key_tfm))
               ^~~~~~~~~~~~~~~
   include/linux/err.h:36:9: note: Assuming the condition is false
           return IS_ERR_VALUE((unsigned long)ptr);
                  ^
   include/linux/err.h:22:34: note: expanded from macro 'IS_ERR_VALUE'
   #define IS_ERR_VALUE(x) unlikely((unsigned long)(void *)(x) >= (unsigned long)-MAX_ERRNO)
                           ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/compiler.h:78:42: note: expanded from macro 'unlikely'
   # define unlikely(x)    __builtin_expect(!!(x), 0)
                                               ^
   include/linux/err.h:36:2: note: Returning zero, which participates in a condition later
           return IS_ERR_VALUE((unsigned long)ptr);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/nvme/host/auth.c:270:6: note: Returning from 'IS_ERR'
           if (IS_ERR(key_tfm))
               ^~~~~~~~~~~~~~~
   drivers/nvme/host/auth.c:270:2: note: Taking false branch
           if (IS_ERR(key_tfm))
           ^
   drivers/nvme/host/auth.c:276:6: note: Assuming 'shash' is null
           if (!shash) {
               ^~~~~~
   drivers/nvme/host/auth.c:276:2: note: Taking true branch
           if (!shash) {
           ^
   drivers/nvme/host/auth.c:278:3: note: Control jumps to line 304
                   goto out_free_key;
                   ^
   drivers/nvme/host/auth.c:305:6: note: 'ret' is < 0
           if (ret < 0) {
               ^~~
   drivers/nvme/host/auth.c:305:2: note: Taking true branch
           if (ret < 0) {
           ^
   drivers/nvme/host/auth.c:306:3: note: 1st function call argument is an uninitialized value
                   kfree_sensitive(transformed_key);
                   ^               ~~~~~~~~~~~~~~~
>> drivers/nvme/host/auth.c:821:23: warning: Assigned value is garbage or undefined [clang-analyzer-core.uninitialized.Assign]
           ctrl->dhchap_key_len = key_len;
                                ^
   drivers/nvme/host/auth.c:1125:2: note: Loop condition is false.  Exiting loop
           INIT_WORK(&ctrl->dhchap_auth_work, nvme_dhchap_auth_work);
           ^
   include/linux/workqueue.h:245:2: note: expanded from macro 'INIT_WORK'
           __INIT_WORK((_work), (_func), 0)
           ^
   include/linux/workqueue.h:225:2: note: expanded from macro '__INIT_WORK'
           do {                                                            \
           ^
   drivers/nvme/host/auth.c:1126:2: note: Loop condition is false.  Exiting loop
           mutex_init(&ctrl->dhchap_auth_mutex);
           ^
   include/linux/mutex.h:101:32: note: expanded from macro 'mutex_init'
   #define mutex_init(mutex)                                               \
                                                                           ^
   drivers/nvme/host/auth.c:1127:2: note: Calling 'nvme_auth_generate_key'
           nvme_auth_generate_key(ctrl);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/nvme/host/auth.c:801:2: note: 'key_len' declared without an initial value
           size_t key_len;
           ^~~~~~~~~~~~~~
   drivers/nvme/host/auth.c:804:6: note: Assuming 'secret' is non-null
           if (!secret)
               ^~~~~~~
   drivers/nvme/host/auth.c:804:2: note: Taking false branch
           if (!secret)
           ^
   drivers/nvme/host/auth.c:807:6: note: Assuming the condition is false
           if (sscanf(secret, "DHHC-1:%hhd:%*s:", &key_hash) != 1)
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/nvme/host/auth.c:807:2: note: Taking false branch
           if (sscanf(secret, "DHHC-1:%hhd:%*s:", &key_hash) != 1)
           ^
   drivers/nvme/host/auth.c:811:8: note: Calling 'nvme_auth_extract_secret'
           key = nvme_auth_extract_secret(secret + 10, key_hash,
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/nvme/host/auth.c:201:6: note: Assuming 'p' is null
           if (p)
               ^
   drivers/nvme/host/auth.c:201:2: note: Taking false branch
           if (p)
           ^
   drivers/nvme/host/auth.c:204:6: note: Assuming 'key' is non-null
           if (!key)
               ^~~~
   drivers/nvme/host/auth.c:204:2: note: Taking false branch
           if (!key)
           ^
   drivers/nvme/host/auth.c:208:6: note: Assuming 'key_len' is < 0
           if (key_len < 0) {
               ^~~~~~~~~~~
   drivers/nvme/host/auth.c:208:2: note: Taking true branch
           if (key_len < 0) {
           ^
   drivers/nvme/host/auth.c:209:3: note: Taking false branch
                   pr_debug("base64 key decoding error %d\n",
                   ^
   include/linux/printk.h:576:2: note: expanded from macro 'pr_debug'
           no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
           ^
   include/linux/printk.h:131:2: note: expanded from macro 'no_printk'
           if (0)                                          \
           ^
   drivers/nvme/host/auth.c:211:3: note: Returning without writing to '*'
                   return ERR_PTR(key_len);
                   ^
   drivers/nvme/host/auth.c:811:8: note: Returning from 'nvme_auth_extract_secret'
           key = nvme_auth_extract_secret(secret + 10, key_hash,
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/nvme/host/auth.c:813:6: note: Calling 'IS_ERR'
           if (IS_ERR(key)) {
               ^~~~~~~~~~~
   include/linux/err.h:36:9: note: Assuming the condition is false
           return IS_ERR_VALUE((unsigned long)ptr);
                  ^
   include/linux/err.h:22:34: note: expanded from macro 'IS_ERR_VALUE'
   #define IS_ERR_VALUE(x) unlikely((unsigned long)(void *)(x) >= (unsigned long)-MAX_ERRNO)
                           ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/compiler.h:78:42: note: expanded from macro 'unlikely'
   # define unlikely(x)    __builtin_expect(!!(x), 0)
                                               ^
   include/linux/err.h:36:2: note: Returning zero, which participates in a condition later
           return IS_ERR_VALUE((unsigned long)ptr);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/nvme/host/auth.c:813:6: note: Returning from 'IS_ERR'
           if (IS_ERR(key)) {
               ^~~~~~~~~~~
   drivers/nvme/host/auth.c:813:2: note: Taking false branch
           if (IS_ERR(key)) {
           ^
   drivers/nvme/host/auth.c:821:23: note: Assigned value is garbage or undefined
           ctrl->dhchap_key_len = key_len;
                                ^ ~~~~~~~
   drivers/nvme/host/auth.c:849:28: warning: Assigned value is garbage or undefined [clang-analyzer-core.uninitialized.Assign]
           ctrl->dhchap_ctrl_key_len = key_len;
                                     ^
   drivers/nvme/host/auth.c:1125:2: note: Loop condition is false.  Exiting loop
           INIT_WORK(&ctrl->dhchap_auth_work, nvme_dhchap_auth_work);

vim +821 drivers/nvme/host/auth.c

306a253f85fb90 Hannes Reinecke 2021-11-12  796  
306a253f85fb90 Hannes Reinecke 2021-11-12  797  int nvme_auth_generate_key(struct nvme_ctrl *ctrl)
306a253f85fb90 Hannes Reinecke 2021-11-12  798  {
306a253f85fb90 Hannes Reinecke 2021-11-12  799  	u8 *secret = ctrl->opts->dhchap_secret;
306a253f85fb90 Hannes Reinecke 2021-11-12  800  	u8 *key;
306a253f85fb90 Hannes Reinecke 2021-11-12  801  	size_t key_len;
306a253f85fb90 Hannes Reinecke 2021-11-12  802  	u8 key_hash;
306a253f85fb90 Hannes Reinecke 2021-11-12  803  
306a253f85fb90 Hannes Reinecke 2021-11-12  804  	if (!secret)
306a253f85fb90 Hannes Reinecke 2021-11-12  805  		return 0;
306a253f85fb90 Hannes Reinecke 2021-11-12  806  
306a253f85fb90 Hannes Reinecke 2021-11-12  807  	if (sscanf(secret, "DHHC-1:%hhd:%*s:", &key_hash) != 1)
306a253f85fb90 Hannes Reinecke 2021-11-12  808  		return -EINVAL;
306a253f85fb90 Hannes Reinecke 2021-11-12  809  
306a253f85fb90 Hannes Reinecke 2021-11-12  810  	/* Pass in the secret without the 'DHHC-1:XX:' prefix */
306a253f85fb90 Hannes Reinecke 2021-11-12  811  	key = nvme_auth_extract_secret(secret + 10, key_hash,
306a253f85fb90 Hannes Reinecke 2021-11-12  812  				       &key_len);
306a253f85fb90 Hannes Reinecke 2021-11-12  813  	if (IS_ERR(key)) {
306a253f85fb90 Hannes Reinecke 2021-11-12  814  		dev_dbg(ctrl->device, "failed to extract key, error %ld\n",
306a253f85fb90 Hannes Reinecke 2021-11-12  815  			PTR_ERR(key));
306a253f85fb90 Hannes Reinecke 2021-11-12  816  		return PTR_ERR(key);
306a253f85fb90 Hannes Reinecke 2021-11-12  817  	}
306a253f85fb90 Hannes Reinecke 2021-11-12  818  
306a253f85fb90 Hannes Reinecke 2021-11-12  819  	ctrl->dhchap_key = key;
306a253f85fb90 Hannes Reinecke 2021-11-12  820  	key = NULL;
306a253f85fb90 Hannes Reinecke 2021-11-12 @821  	ctrl->dhchap_key_len = key_len;
306a253f85fb90 Hannes Reinecke 2021-11-12  822  	ctrl->dhchap_key_hash = key_hash;
306a253f85fb90 Hannes Reinecke 2021-11-12  823  
306a253f85fb90 Hannes Reinecke 2021-11-12  824  	return 0;
306a253f85fb90 Hannes Reinecke 2021-11-12  825  }
306a253f85fb90 Hannes Reinecke 2021-11-12  826  EXPORT_SYMBOL_GPL(nvme_auth_generate_key);
306a253f85fb90 Hannes Reinecke 2021-11-12  827  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 33214 bytes --]

             reply	other threads:[~2021-11-20 21:09 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-20 21:09 kernel test robot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-12-02 15:23 [PATCHv8 00/12] nvme: In-band authentication support Hannes Reinecke
2021-12-02 15:23 ` [PATCH 07/12] nvme: Implement In-Band authentication Hannes Reinecke
2022-03-22 11:40   ` Max Gurtovoy
2022-03-22 12:10     ` Hannes Reinecke
2022-03-22 12:21       ` Max Gurtovoy
2022-03-22 12:44         ` Hannes Reinecke
2021-11-23 12:37 [PATCHv7 00/12] nvme: In-band authentication support Hannes Reinecke
2021-11-23 12:37 ` [PATCH 07/12] nvme: Implement In-Band authentication Hannes Reinecke
2021-11-23 13:11   ` Sagi Grimberg
2021-11-23 13:30     ` Hannes Reinecke
2021-11-22  7:47 [PATCHv6 00/12] nvme: In-band authentication support Hannes Reinecke
2021-11-22  7:47 ` [PATCH 07/12] nvme: Implement In-Band authentication Hannes Reinecke
2021-11-22  8:12   ` Sagi Grimberg
2021-11-22  9:15     ` Hannes Reinecke
2021-11-23  9:02   ` Chaitanya Kulkarni
2021-11-12 12:59 [PATCHv5 00/12] nvme: In-band authentication support Hannes Reinecke
2021-11-12 12:59 ` [PATCH 07/12] nvme: Implement In-Band authentication Hannes Reinecke
2021-11-16 10:25   ` Sagi Grimberg
2021-11-16 10:40     ` Hannes Reinecke
2021-11-16 10:35   ` Sagi Grimberg
2021-11-16 10:41     ` Hannes Reinecke
2021-09-28  6:03 [PATCHv4 00/12] nvme: In-band authentication support Hannes Reinecke
2021-09-28  6:03 ` [PATCH 07/12] nvme: Implement In-Band authentication Hannes Reinecke
2021-09-28  6:03   ` Hannes Reinecke
2021-09-10  6:43 [PATCHv3 00/12] nvme: In-band authentication support Hannes Reinecke
2021-09-10  6:43 ` [PATCH 07/12] nvme: Implement In-Band authentication Hannes Reinecke
2021-09-10  6:43   ` Hannes Reinecke
2021-09-13 13:55   ` Sagi Grimberg
2021-09-13 13:55     ` Sagi Grimberg
2021-09-13 14:33     ` Hannes Reinecke
2021-09-13 14:33       ` Hannes Reinecke
2021-09-14  7:06       ` Sagi Grimberg
2021-09-14  7:06         ` Sagi Grimberg
2021-09-14  7:19         ` Hannes Reinecke
2021-09-14  7:19           ` Hannes Reinecke
2021-09-16 17:23   ` Chaitanya Kulkarni
2021-09-26 22:04   ` Sagi Grimberg
2021-09-26 22:04     ` Sagi Grimberg
2021-09-27  7:26     ` Hannes Reinecke
2021-09-27  7:26       ` Hannes Reinecke
2021-09-27  7:52       ` Sagi Grimberg
2021-09-27  7:52         ` Sagi Grimberg
2021-09-26 22:53   ` Sagi Grimberg
2021-09-26 22:53     ` Sagi Grimberg
2021-09-27  5:48     ` Hannes Reinecke
2021-09-27  5:48       ` Hannes Reinecke
2021-09-27  7:52       ` Sagi Grimberg
2021-09-27  7:52         ` Sagi Grimberg

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=202111210541.MENoUt8o-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild@lists.01.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.