From: kernel test robot <lkp@intel.com>
To: Hannes Reinecke <hare@suse.de>
Cc: llvm@lists.linux.dev, kbuild-all@lists.01.org
Subject: Re: [PATCH 11/12] nvmet-auth: Diffie-Hellman key exchange support
Date: Sat, 27 Nov 2021 04:04:08 +0800 [thread overview]
Message-ID: <202111270313.t95s8nb5-lkp@intel.com> (raw)
In-Reply-To: <20211123123801.73197-12-hare@suse.de>
Hi Hannes,
I love your patch! Perhaps something to improve:
[auto build test WARNING on herbert-cryptodev-2.6/master]
[also build test WARNING on linus/master v5.16-rc2 next-20211126]
[cannot apply to herbert-crypto-2.6/master]
[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/20211123-204008
base: https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git master
config: i386-randconfig-r035-20211126 (https://download.01.org/0day-ci/archive/20211127/202111270313.t95s8nb5-lkp@intel.com/config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 5162b558d8c0b542e752b037e72a69d5fd51eb1e)
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
# https://github.com/0day-ci/linux/commit/34bd34a0ee0dbaeeb36f3264e50be3a533491d97
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Hannes-Reinecke/nvme-In-band-authentication-support/20211123-204008
git checkout 34bd34a0ee0dbaeeb36f3264e50be3a533491d97
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=i386 SHELL=/bin/bash drivers/nvme/target/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
>> drivers/nvme/target/fabrics-cmd-auth.c:352:35: warning: format specifies type 'unsigned long' but the argument has type 'size_t' (aka 'unsigned int') [-Wformat]
req->sq->dhchap_tid, data->hl, ctrl->dh_keysize);
^~~~~~~~~~~~~~~~
include/linux/printk.h:576:38: note: expanded from macro 'pr_debug'
no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
~~~ ^~~~~~~~~~~
include/linux/printk.h:132:17: note: expanded from macro 'no_printk'
printk(fmt, ##__VA_ARGS__); \
~~~ ^~~~~~~~~~~
include/linux/printk.h:446:60: note: expanded from macro 'printk'
#define printk(fmt, ...) printk_index_wrap(_printk, fmt, ##__VA_ARGS__)
~~~ ^~~~~~~~~~~
include/linux/printk.h:418:19: note: expanded from macro 'printk_index_wrap'
_p_func(_fmt, ##__VA_ARGS__); \
~~~~ ^~~~~~~~~~~
1 warning generated.
--
>> drivers/nvme/target/auth.c:490:18: warning: format specifies type 'unsigned long' but the argument has type 'size_t' (aka 'unsigned int') [-Wformat]
ctrl->cntlid, ctrl->dh_keysize, buf_size);
^~~~~~~~~~~~~~~~
include/linux/printk.h:499:37: note: expanded from macro 'pr_warn'
printk(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__)
~~~ ^~~~~~~~~~~
include/linux/printk.h:446:60: note: expanded from macro 'printk'
#define printk(fmt, ...) printk_index_wrap(_printk, fmt, ##__VA_ARGS__)
~~~ ^~~~~~~~~~~
include/linux/printk.h:418:19: note: expanded from macro 'printk_index_wrap'
_p_func(_fmt, ##__VA_ARGS__); \
~~~~ ^~~~~~~~~~~
1 warning generated.
vim +352 drivers/nvme/target/fabrics-cmd-auth.c
315
316 static int nvmet_auth_challenge(struct nvmet_req *req, void *d, int al)
317 {
318 struct nvmf_auth_dhchap_challenge_data *data = d;
319 struct nvmet_ctrl *ctrl = req->sq->ctrl;
320 int ret = 0;
321 int hash_len = nvme_auth_hmac_hash_len(ctrl->shash_id);
322 int data_size = sizeof(*d) + hash_len;
323
324 if (ctrl->dh_tfm)
325 data_size += ctrl->dh_keysize;
326 if (al < data_size) {
327 pr_debug("%s: buffer too small (al %d need %d)\n", __func__,
328 al, data_size);
329 return -EINVAL;
330 }
331 memset(data, 0, data_size);
332 req->sq->dhchap_s1 = ctrl->dhchap_seqnum++;
333 data->auth_type = NVME_AUTH_DHCHAP_MESSAGES;
334 data->auth_id = NVME_AUTH_DHCHAP_MESSAGE_CHALLENGE;
335 data->t_id = cpu_to_le16(req->sq->dhchap_tid);
336 data->hashid = ctrl->shash_id;
337 data->hl = hash_len;
338 data->seqnum = cpu_to_le32(req->sq->dhchap_s1);
339 req->sq->dhchap_c1 = kmalloc(data->hl, GFP_KERNEL);
340 if (!req->sq->dhchap_c1)
341 return -ENOMEM;
342 get_random_bytes(req->sq->dhchap_c1, data->hl);
343 memcpy(data->cval, req->sq->dhchap_c1, data->hl);
344 if (ctrl->dh_tfm) {
345 data->dhgid = ctrl->dh_gid;
346 data->dhvlen = cpu_to_le32(ctrl->dh_keysize);
347 ret = nvmet_auth_ctrl_exponential(req, data->cval + data->hl,
348 ctrl->dh_keysize);
349 }
350 pr_debug("%s: ctrl %d qid %d seq %d transaction %d hl %d dhvlen %lu\n",
351 __func__, ctrl->cntlid, req->sq->qid, req->sq->dhchap_s1,
> 352 req->sq->dhchap_tid, data->hl, ctrl->dh_keysize);
353 return ret;
354 }
355
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: Re: [PATCH 11/12] nvmet-auth: Diffie-Hellman key exchange support
Date: Sat, 27 Nov 2021 04:04:08 +0800 [thread overview]
Message-ID: <202111270313.t95s8nb5-lkp@intel.com> (raw)
In-Reply-To: <20211123123801.73197-12-hare@suse.de>
[-- Attachment #1: Type: text/plain, Size: 5699 bytes --]
Hi Hannes,
I love your patch! Perhaps something to improve:
[auto build test WARNING on herbert-cryptodev-2.6/master]
[also build test WARNING on linus/master v5.16-rc2 next-20211126]
[cannot apply to herbert-crypto-2.6/master]
[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/20211123-204008
base: https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git master
config: i386-randconfig-r035-20211126 (https://download.01.org/0day-ci/archive/20211127/202111270313.t95s8nb5-lkp(a)intel.com/config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 5162b558d8c0b542e752b037e72a69d5fd51eb1e)
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
# https://github.com/0day-ci/linux/commit/34bd34a0ee0dbaeeb36f3264e50be3a533491d97
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Hannes-Reinecke/nvme-In-band-authentication-support/20211123-204008
git checkout 34bd34a0ee0dbaeeb36f3264e50be3a533491d97
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=i386 SHELL=/bin/bash drivers/nvme/target/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
>> drivers/nvme/target/fabrics-cmd-auth.c:352:35: warning: format specifies type 'unsigned long' but the argument has type 'size_t' (aka 'unsigned int') [-Wformat]
req->sq->dhchap_tid, data->hl, ctrl->dh_keysize);
^~~~~~~~~~~~~~~~
include/linux/printk.h:576:38: note: expanded from macro 'pr_debug'
no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
~~~ ^~~~~~~~~~~
include/linux/printk.h:132:17: note: expanded from macro 'no_printk'
printk(fmt, ##__VA_ARGS__); \
~~~ ^~~~~~~~~~~
include/linux/printk.h:446:60: note: expanded from macro 'printk'
#define printk(fmt, ...) printk_index_wrap(_printk, fmt, ##__VA_ARGS__)
~~~ ^~~~~~~~~~~
include/linux/printk.h:418:19: note: expanded from macro 'printk_index_wrap'
_p_func(_fmt, ##__VA_ARGS__); \
~~~~ ^~~~~~~~~~~
1 warning generated.
--
>> drivers/nvme/target/auth.c:490:18: warning: format specifies type 'unsigned long' but the argument has type 'size_t' (aka 'unsigned int') [-Wformat]
ctrl->cntlid, ctrl->dh_keysize, buf_size);
^~~~~~~~~~~~~~~~
include/linux/printk.h:499:37: note: expanded from macro 'pr_warn'
printk(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__)
~~~ ^~~~~~~~~~~
include/linux/printk.h:446:60: note: expanded from macro 'printk'
#define printk(fmt, ...) printk_index_wrap(_printk, fmt, ##__VA_ARGS__)
~~~ ^~~~~~~~~~~
include/linux/printk.h:418:19: note: expanded from macro 'printk_index_wrap'
_p_func(_fmt, ##__VA_ARGS__); \
~~~~ ^~~~~~~~~~~
1 warning generated.
vim +352 drivers/nvme/target/fabrics-cmd-auth.c
315
316 static int nvmet_auth_challenge(struct nvmet_req *req, void *d, int al)
317 {
318 struct nvmf_auth_dhchap_challenge_data *data = d;
319 struct nvmet_ctrl *ctrl = req->sq->ctrl;
320 int ret = 0;
321 int hash_len = nvme_auth_hmac_hash_len(ctrl->shash_id);
322 int data_size = sizeof(*d) + hash_len;
323
324 if (ctrl->dh_tfm)
325 data_size += ctrl->dh_keysize;
326 if (al < data_size) {
327 pr_debug("%s: buffer too small (al %d need %d)\n", __func__,
328 al, data_size);
329 return -EINVAL;
330 }
331 memset(data, 0, data_size);
332 req->sq->dhchap_s1 = ctrl->dhchap_seqnum++;
333 data->auth_type = NVME_AUTH_DHCHAP_MESSAGES;
334 data->auth_id = NVME_AUTH_DHCHAP_MESSAGE_CHALLENGE;
335 data->t_id = cpu_to_le16(req->sq->dhchap_tid);
336 data->hashid = ctrl->shash_id;
337 data->hl = hash_len;
338 data->seqnum = cpu_to_le32(req->sq->dhchap_s1);
339 req->sq->dhchap_c1 = kmalloc(data->hl, GFP_KERNEL);
340 if (!req->sq->dhchap_c1)
341 return -ENOMEM;
342 get_random_bytes(req->sq->dhchap_c1, data->hl);
343 memcpy(data->cval, req->sq->dhchap_c1, data->hl);
344 if (ctrl->dh_tfm) {
345 data->dhgid = ctrl->dh_gid;
346 data->dhvlen = cpu_to_le32(ctrl->dh_keysize);
347 ret = nvmet_auth_ctrl_exponential(req, data->cval + data->hl,
348 ctrl->dh_keysize);
349 }
350 pr_debug("%s: ctrl %d qid %d seq %d transaction %d hl %d dhvlen %lu\n",
351 __func__, ctrl->cntlid, req->sq->qid, req->sq->dhchap_s1,
> 352 req->sq->dhchap_tid, data->hl, ctrl->dh_keysize);
353 return ret;
354 }
355
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
next prev parent reply other threads:[~2021-11-26 20:04 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-23 12:37 [PATCHv7 00/12] nvme: In-band authentication support Hannes Reinecke
2021-11-23 12:37 ` [PATCH 01/12] crypto: add crypto_has_shash() Hannes Reinecke
2021-11-23 12:37 ` [PATCH 02/12] crypto: add crypto_has_kpp() Hannes Reinecke
2021-11-23 12:37 ` [PATCH 03/12] crypto/ffdhe: Finite Field DH Ephemeral Parameters Hannes Reinecke
2021-11-23 12:37 ` [PATCH 04/12] lib/base64: RFC4648-compliant base64 encoding Hannes Reinecke
2021-11-23 18:19 ` Eric Biggers
2021-11-23 12:37 ` [PATCH 05/12] nvme: add definitions for NVMe In-Band authentication Hannes Reinecke
2021-11-23 12:37 ` [PATCH 06/12] nvme-fabrics: decode 'authentication required' connect error 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-23 12:37 ` [PATCH 08/12] nvme-auth: Diffie-Hellman key exchange support Hannes Reinecke
2021-11-23 12:37 ` [PATCH 09/12] nvmet: Parse fabrics commands on all queues Hannes Reinecke
2021-11-26 7:52 ` Christoph Hellwig
2021-11-23 12:37 ` [PATCH 10/12] nvmet: Implement basic In-Band Authentication Hannes Reinecke
2021-11-23 12:38 ` [PATCH 11/12] nvmet-auth: Diffie-Hellman key exchange support Hannes Reinecke
2021-11-23 15:22 ` kernel test robot
2021-11-26 20:04 ` kernel test robot [this message]
2021-11-26 20:04 ` kernel test robot
2021-11-23 12:38 ` [PATCH 12/12] nvmet-auth: expire authentication sessions Hannes Reinecke
-- 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 11/12] nvmet-auth: Diffie-Hellman key exchange support Hannes Reinecke
2021-11-22 7:47 [PATCHv6 00/12] nvme: In-band authentication support Hannes Reinecke
2021-11-22 7:47 ` [PATCH 11/12] nvmet-auth: Diffie-Hellman key exchange support Hannes Reinecke
2021-11-12 12:59 [PATCHv5 00/12] nvme: In-band authentication support Hannes Reinecke
2021-11-12 12:59 ` [PATCH 11/12] nvmet-auth: Diffie-Hellman key exchange support Hannes Reinecke
2021-11-19 19:34 ` kernel test robot
2021-09-28 6:03 [PATCHv4 00/12] nvme: In-band authentication support Hannes Reinecke
2021-09-28 6:03 ` [PATCH 11/12] nvmet-auth: Diffie-Hellman key exchange support 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 11/12] nvmet-auth: Diffie-Hellman key exchange support Hannes Reinecke
2021-09-10 6:43 ` Hannes Reinecke
2021-09-11 23:47 ` kernel test robot
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=202111270313.t95s8nb5-lkp@intel.com \
--to=lkp@intel.com \
--cc=hare@suse.de \
--cc=kbuild-all@lists.01.org \
--cc=llvm@lists.linux.dev \
/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.