[hare-scsi-devel:auth.v2 7/12] drivers/nvme/target/nvmet.h:728:58: sparse: sparse: incorrect type in return expression (different base types)
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/hare/scsi-devel.git auth.v2
head: 9107ea4a3526c6801b38b7a2345b7372278a35ba
commit: ca7a6b4cc19e4383ec693c75bb5c6f678b692a14 [7/12] nvmet: Implement basic In-Band Authentication
config: i386-randconfig-s001-20210713 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.3-341-g8af24329-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/hare/scsi-devel.git/commi...
git remote add hare-scsi-devel https://git.kernel.org/pub/scm/linux/kernel/git/hare/scsi-devel.git
git fetch --no-tags hare-scsi-devel auth.v2
git checkout ca7a6b4cc19e4383ec693c75bb5c6f678b692a14
# save the attached .config to linux build tree
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=i386
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
sparse warnings: (new ones prefixed by >>)
drivers/nvme/target/trace.c: note: in included file (through drivers/nvme/target/trace.h):
>> drivers/nvme/target/nvmet.h:728:58: sparse: sparse: incorrect type in return expression (different base types) @@ expected char @@ got void * @@
drivers/nvme/target/nvmet.h:728:58: sparse: expected char
drivers/nvme/target/nvmet.h:728:58: sparse: got void *
drivers/nvme/target/nvmet.h:728:12: sparse: sparse: symbol 'nvmet_dhchap_dhgroup_name' was not declared. Should it be static?
--
drivers/nvme/target/io-cmd-bdev.c: note: in included file:
>> drivers/nvme/target/nvmet.h:728:58: sparse: sparse: incorrect type in return expression (different base types) @@ expected char @@ got void * @@
drivers/nvme/target/nvmet.h:728:58: sparse: expected char
drivers/nvme/target/nvmet.h:728:58: sparse: got void *
drivers/nvme/target/nvmet.h:728:12: sparse: sparse: symbol 'nvmet_dhchap_dhgroup_name' was not declared. Should it be static?
--
drivers/nvme/target/discovery.c: note: in included file:
>> drivers/nvme/target/nvmet.h:728:58: sparse: sparse: incorrect type in return expression (different base types) @@ expected char @@ got void * @@
drivers/nvme/target/nvmet.h:728:58: sparse: expected char
drivers/nvme/target/nvmet.h:728:58: sparse: got void *
drivers/nvme/target/nvmet.h:728:12: sparse: sparse: symbol 'nvmet_dhchap_dhgroup_name' was not declared. Should it be static?
--
drivers/nvme/target/io-cmd-file.c: note: in included file:
>> drivers/nvme/target/nvmet.h:728:58: sparse: sparse: incorrect type in return expression (different base types) @@ expected char @@ got void * @@
drivers/nvme/target/nvmet.h:728:58: sparse: expected char
drivers/nvme/target/nvmet.h:728:58: sparse: got void *
drivers/nvme/target/nvmet.h:728:12: sparse: sparse: symbol 'nvmet_dhchap_dhgroup_name' was not declared. Should it be static?
--
drivers/nvme/target/admin-cmd.c: note: in included file:
>> drivers/nvme/target/nvmet.h:728:58: sparse: sparse: incorrect type in return expression (different base types) @@ expected char @@ got void * @@
drivers/nvme/target/nvmet.h:728:58: sparse: expected char
drivers/nvme/target/nvmet.h:728:58: sparse: got void *
drivers/nvme/target/nvmet.h:728:12: sparse: sparse: symbol 'nvmet_dhchap_dhgroup_name' was not declared. Should it be static?
--
drivers/nvme/target/zns.c: note: in included file:
>> drivers/nvme/target/nvmet.h:728:58: sparse: sparse: incorrect type in return expression (different base types) @@ expected char @@ got void * @@
drivers/nvme/target/nvmet.h:728:58: sparse: expected char
drivers/nvme/target/nvmet.h:728:58: sparse: got void *
drivers/nvme/target/nvmet.h:728:12: sparse: sparse: symbol 'nvmet_dhchap_dhgroup_name' was not declared. Should it be static?
--
drivers/nvme/target/passthru.c: note: in included file:
>> drivers/nvme/target/nvmet.h:728:58: sparse: sparse: incorrect type in return expression (different base types) @@ expected char @@ got void * @@
drivers/nvme/target/nvmet.h:728:58: sparse: expected char
drivers/nvme/target/nvmet.h:728:58: sparse: got void *
drivers/nvme/target/nvmet.h:728:12: sparse: sparse: symbol 'nvmet_dhchap_dhgroup_name' was not declared. Should it be static?
--
drivers/nvme/target/configfs.c: note: in included file:
>> drivers/nvme/target/nvmet.h:728:58: sparse: sparse: incorrect type in return expression (different base types) @@ expected char @@ got void * @@
drivers/nvme/target/nvmet.h:728:58: sparse: expected char
drivers/nvme/target/nvmet.h:728:58: sparse: got void *
drivers/nvme/target/nvmet.h:728:12: sparse: sparse: symbol 'nvmet_dhchap_dhgroup_name' was not declared. Should it be static?
--
drivers/nvme/target/loop.c: note: in included file:
>> drivers/nvme/target/nvmet.h:728:58: sparse: sparse: incorrect type in return expression (different base types) @@ expected char @@ got void * @@
drivers/nvme/target/nvmet.h:728:58: sparse: expected char
drivers/nvme/target/nvmet.h:728:58: sparse: got void *
drivers/nvme/target/nvmet.h:728:12: sparse: sparse: symbol 'nvmet_dhchap_dhgroup_name' was not declared. Should it be static?
--
drivers/nvme/target/core.c: note: in included file (through drivers/nvme/target/trace.h):
>> drivers/nvme/target/nvmet.h:728:58: sparse: sparse: incorrect type in return expression (different base types) @@ expected char @@ got void * @@
drivers/nvme/target/nvmet.h:728:58: sparse: expected char
drivers/nvme/target/nvmet.h:728:58: sparse: got void *
drivers/nvme/target/nvmet.h:728:12: sparse: sparse: symbol 'nvmet_dhchap_dhgroup_name' was not declared. Should it be static?
vim +728 drivers/nvme/target/nvmet.h
687
688 #ifdef CONFIG_NVME_TARGET_AUTH
689 void nvmet_execute_auth_send(struct nvmet_req *req);
690 void nvmet_execute_auth_receive(struct nvmet_req *req);
691 int nvmet_auth_set_host_key(struct nvmet_host *host, const char *secret);
692 int nvmet_auth_set_host_hash(struct nvmet_host *host, const char *hash);
693 int nvmet_auth_get_hash(struct nvmet_ctrl *ctrl, unsigned int *hash_len);
694 const char *nvmet_auth_hmac_name(int hmac_id);
695 int nvmet_auth_set_host_dhgroup(struct nvmet_host *host, const char *hash);
696 const char *nvmet_auth_get_host_dhgroup(struct nvmet_host *host);
697 int nvmet_setup_auth(struct nvmet_ctrl *ctrl, struct nvmet_req *req);
698 void nvmet_reset_auth(struct nvmet_ctrl *ctrl);
699 int nvmet_setup_dhgroup(struct nvmet_ctrl *ctrl, int dhgroup_id);
700 bool nvmet_check_auth_status(struct nvmet_req *req);
701 int nvmet_auth_host_hash(struct nvmet_req *req, u8 *response,
702 unsigned int hash_len);
703 int nvmet_auth_ctrl_hash(struct nvmet_req *req, u8 *response,
704 unsigned int hash_len);
705 static inline bool nvmet_has_auth(struct nvmet_ctrl *ctrl)
706 {
707 return ctrl->shash_tfm != NULL;
708 }
709 const char *nvmet_dhchap_dhgroup_name(int dhgid);
710 int nvmet_auth_ctrl_exponential(struct nvmet_req *req,
711 u8 *buf, int buf_size);
712 int nvmet_auth_ctrl_sesskey(struct nvmet_req *req,
713 u8 *buf, int buf_size);
714 #else
715 static inline int nvmet_setup_auth(struct nvmet_ctrl *ctrl, struct nvmet_req *req)
716 {
717 return 0;
718 }
719 static inline void nvmet_reset_auth(struct nvmet_ctrl *ctrl) {};
720 static inline bool nvmet_check_auth_status(struct nvmet_req *req)
721 {
722 return true;
723 }
724 static inline bool nvmet_has_auth(struct nvmet_ctrl *ctrl)
725 {
726 return false;
727 }
> 728 const char nvmet_dhchap_dhgroup_name(int dhgid) { return NULL; }
729 #endif
730
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 2 months
Re: [PATCH bpf-next v3 3/5] net: bonding: Add XDP support to the bonding driver
by kernel test robot
Hi Jussi,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on bpf-next/master]
url: https://github.com/0day-ci/linux/commits/Jussi-Maki/net-bonding-Refactor-...
base: https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
config: m68k-randconfig-s032-20210713 (attached as .config)
compiler: m68k-linux-gcc (GCC) 9.3.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.3-341-g8af24329-dirty
# https://github.com/0day-ci/linux/commit/127745a2455bc3577cdcafb06381fa4da...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Jussi-Maki/net-bonding-Refactor-bond_xmit_hash-for-use-with-xdp_buff/20210707-211616
git checkout 127745a2455bc3577cdcafb06381fa4da354f8c2
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=m68k
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
sparse warnings: (new ones prefixed by >>)
drivers/net/bonding/bond_main.c:2671:26: sparse: sparse: restricted __be16 degrades to integer
drivers/net/bonding/bond_main.c:2677:20: sparse: sparse: restricted __be16 degrades to integer
drivers/net/bonding/bond_main.c:2724:40: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __be16 [usertype] vlan_proto @@ got int @@
drivers/net/bonding/bond_main.c:2724:40: sparse: expected restricted __be16 [usertype] vlan_proto
drivers/net/bonding/bond_main.c:2724:40: sparse: got int
>> drivers/net/bonding/bond_main.c:4632:16: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct bond_up_slave *slaves @@ got struct bond_up_slave [noderef] __rcu *usable_slaves @@
drivers/net/bonding/bond_main.c:4632:16: sparse: expected struct bond_up_slave *slaves
drivers/net/bonding/bond_main.c:4632:16: sparse: got struct bond_up_slave [noderef] __rcu *usable_slaves
drivers/net/bonding/bond_main.c:3563:52: sparse: sparse: restricted __be16 degrades to integer
drivers/net/bonding/bond_main.c:3563:52: sparse: sparse: restricted __be16 degrades to integer
vim +4632 drivers/net/bonding/bond_main.c
4623
4624 static struct slave *bond_xdp_xmit_3ad_xor_slave_get(struct bonding *bond,
4625 struct xdp_buff *xdp)
4626 {
4627 struct bond_up_slave *slaves;
4628 unsigned int count;
4629 u32 hash;
4630
4631 hash = bond_xmit_hash_xdp(bond, xdp);
> 4632 slaves = bond->usable_slaves;
4633 count = slaves ? READ_ONCE(slaves->count) : 0;
4634 if (unlikely(!count))
4635 return NULL;
4636
4637 return slaves->arr[hash % count];
4638 }
4639
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 2 months
[PATCH v2] drivers:edac: Use DEVICE_ATTR helper macros
by Dwaipayan Ray
Instead of "open coding" DEVICE_ATTR, use the corresponding
helper macros DEVICE_ATTR_{RW,RO_WO} in amd64_edac.c
Some function names needed to be changed to match the device
conventions <foo>_show and <foo>_store, but the functionality
itself is unchanged.
The devices using EDAC_DCT_ATTR_SHOW() are left unchanged.
Signed-off-by: Dwaipayan Ray <dwaipayanray1(a)gmail.com>
---
Changes in v2:
- Revert back the device name changes which broke
the kernel. These were using the macro EDAC_DCT_ATTR_SHOW()
to construct the show methods based on device name.
Reported by Kernel test bot.
drivers/edac/amd64_edac.c | 21 ++++++++-------------
1 file changed, 8 insertions(+), 13 deletions(-)
diff --git a/drivers/edac/amd64_edac.c b/drivers/edac/amd64_edac.c
index f0d8f60acee1..99b06a3e8fb1 100644
--- a/drivers/edac/amd64_edac.c
+++ b/drivers/edac/amd64_edac.c
@@ -571,8 +571,8 @@ EDAC_DCT_ATTR_SHOW(dbam0);
EDAC_DCT_ATTR_SHOW(top_mem);
EDAC_DCT_ATTR_SHOW(top_mem2);
-static ssize_t hole_show(struct device *dev, struct device_attribute *mattr,
- char *data)
+static ssize_t dram_hole_show(struct device *dev, struct device_attribute *mattr,
+ char *data)
{
struct mem_ctl_info *mci = to_mci(dev);
@@ -593,7 +593,7 @@ static DEVICE_ATTR(dhar, S_IRUGO, dhar_show, NULL);
static DEVICE_ATTR(dbam, S_IRUGO, dbam0_show, NULL);
static DEVICE_ATTR(topmem, S_IRUGO, top_mem_show, NULL);
static DEVICE_ATTR(topmem2, S_IRUGO, top_mem2_show, NULL);
-static DEVICE_ATTR(dram_hole, S_IRUGO, hole_show, NULL);
+static DEVICE_ATTR_RO(dram_hole);
static struct attribute *dbg_attrs[] = {
&dev_attr_dhar.attr,
@@ -802,16 +802,11 @@ static ssize_t inject_write_store(struct device *dev,
* update NUM_INJ_ATTRS in case you add new members
*/
-static DEVICE_ATTR(inject_section, S_IRUGO | S_IWUSR,
- inject_section_show, inject_section_store);
-static DEVICE_ATTR(inject_word, S_IRUGO | S_IWUSR,
- inject_word_show, inject_word_store);
-static DEVICE_ATTR(inject_ecc_vector, S_IRUGO | S_IWUSR,
- inject_ecc_vector_show, inject_ecc_vector_store);
-static DEVICE_ATTR(inject_write, S_IWUSR,
- NULL, inject_write_store);
-static DEVICE_ATTR(inject_read, S_IWUSR,
- NULL, inject_read_store);
+static DEVICE_ATTR_RW(inject_section);
+static DEVICE_ATTR_RW(inject_word);
+static DEVICE_ATTR_RW(inject_ecc_vector);
+static DEVICE_ATTR_WO(inject_write);
+static DEVICE_ATTR_WO(inject_read);
static struct attribute *inj_attrs[] = {
&dev_attr_inject_section.attr,
--
2.28.0
1 year, 2 months
[hare-scsi-devel:auth.v2 9/12] drivers/nvme/host/auth.c:691:5: warning: no previous prototype for 'nvme_auth_dhchap_exponential'
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/hare/scsi-devel.git auth.v2
head: 9107ea4a3526c6801b38b7a2345b7372278a35ba
commit: 9ca30b761b5f46cc6293abdd7fb89cc1732381e9 [9/12] nvme-auth: augmented challenge support
config: x86_64-allyesconfig (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
# https://git.kernel.org/pub/scm/linux/kernel/git/hare/scsi-devel.git/commi...
git remote add hare-scsi-devel https://git.kernel.org/pub/scm/linux/kernel/git/hare/scsi-devel.git
git fetch --no-tags hare-scsi-devel auth.v2
git checkout 9ca30b761b5f46cc6293abdd7fb89cc1732381e9
# save the attached .config to linux build tree
make W=1 ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
drivers/nvme/host/auth.c:43:5: warning: no previous prototype for 'nvme_auth_send' [-Wmissing-prototypes]
43 | int nvme_auth_send(struct nvme_ctrl *ctrl, int qid, void *data, size_t tl)
| ^~~~~~~~~~~~~~
drivers/nvme/host/auth.c:67:5: warning: no previous prototype for 'nvme_auth_receive' [-Wmissing-prototypes]
67 | int nvme_auth_receive(struct nvme_ctrl *ctrl, int qid, void *buf, size_t al,
| ^~~~~~~~~~~~~~~~~
drivers/nvme/host/auth.c:120:5: warning: no previous prototype for 'nvme_auth_dhchap_negotiate' [-Wmissing-prototypes]
120 | int nvme_auth_dhchap_negotiate(struct nvme_ctrl *ctrl,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/nvme/host/auth.c:149:5: warning: no previous prototype for 'nvme_auth_dhchap_challenge' [-Wmissing-prototypes]
149 | int nvme_auth_dhchap_challenge(struct nvme_ctrl *ctrl,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/nvme/host/auth.c:264:5: warning: no previous prototype for 'nvme_auth_dhchap_reply' [-Wmissing-prototypes]
264 | int nvme_auth_dhchap_reply(struct nvme_ctrl *ctrl,
| ^~~~~~~~~~~~~~~~~~~~~~
drivers/nvme/host/auth.c:310:5: warning: no previous prototype for 'nvme_auth_dhchap_success1' [-Wmissing-prototypes]
310 | int nvme_auth_dhchap_success1(struct nvme_ctrl *ctrl,
| ^~~~~~~~~~~~~~~~~~~~~~~~~
drivers/nvme/host/auth.c:355:5: warning: no previous prototype for 'nvme_auth_dhchap_success2' [-Wmissing-prototypes]
355 | int nvme_auth_dhchap_success2(struct nvme_ctrl *ctrl,
| ^~~~~~~~~~~~~~~~~~~~~~~~~
drivers/nvme/host/auth.c:370:5: warning: no previous prototype for 'nvme_auth_dhchap_failure2' [-Wmissing-prototypes]
370 | int nvme_auth_dhchap_failure2(struct nvme_ctrl *ctrl,
| ^~~~~~~~~~~~~~~~~~~~~~~~~
drivers/nvme/host/auth.c:387:5: warning: no previous prototype for 'nvme_auth_select_hash' [-Wmissing-prototypes]
387 | int nvme_auth_select_hash(struct nvme_ctrl *ctrl,
| ^~~~~~~~~~~~~~~~~~~~~
drivers/nvme/host/auth.c:531:5: warning: no previous prototype for 'nvme_auth_dhchap_host_response' [-Wmissing-prototypes]
531 | int nvme_auth_dhchap_host_response(struct nvme_ctrl *ctrl,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/nvme/host/auth.c:590:5: warning: no previous prototype for 'nvme_auth_dhchap_controller_response' [-Wmissing-prototypes]
590 | int nvme_auth_dhchap_controller_response(struct nvme_ctrl *ctrl,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/nvme/host/auth.c:656:5: warning: no previous prototype for 'nvme_auth_generate_key' [-Wmissing-prototypes]
656 | int nvme_auth_generate_key(struct nvme_ctrl *ctrl,
| ^~~~~~~~~~~~~~~~~~~~~~
>> drivers/nvme/host/auth.c:691:5: warning: no previous prototype for 'nvme_auth_dhchap_exponential' [-Wmissing-prototypes]
691 | int nvme_auth_dhchap_exponential(struct nvme_ctrl *ctrl,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
vim +/nvme_auth_dhchap_exponential +691 drivers/nvme/host/auth.c
530
> 531 int nvme_auth_dhchap_host_response(struct nvme_ctrl *ctrl,
532 struct nvme_dhchap_context *chap)
533 {
534 SHASH_DESC_ON_STACK(shash, chap->shash_tfm);
535 u8 buf[4], *challenge = chap->c1;
536 int ret;
537
538 dev_dbg(ctrl->device, "%s: qid %d host response seq %d transaction %d\n",
539 __func__, chap->qid, chap->s1, chap->transaction);
540 if (chap->dh_tfm) {
541 challenge = kmalloc(chap->hash_len, GFP_KERNEL);
542 if (!challenge) {
543 ret = -ENOMEM;
544 goto out;
545 }
546 ret = nvme_auth_augmented_challenge(chap, chap->c1, challenge);
547 if (ret)
548 goto out;
549 }
550 shash->tfm = chap->shash_tfm;
551 ret = crypto_shash_init(shash);
552 if (ret)
553 goto out;
554 ret = crypto_shash_update(shash, challenge, chap->hash_len);
555 if (ret)
556 goto out;
557 put_unaligned_le32(chap->s1, buf);
558 ret = crypto_shash_update(shash, buf, 4);
559 if (ret)
560 goto out;
561 put_unaligned_le16(chap->transaction, buf);
562 ret = crypto_shash_update(shash, buf, 2);
563 if (ret)
564 goto out;
565 memset(buf, 0, sizeof(buf));
566 ret = crypto_shash_update(shash, buf, 1);
567 if (ret)
568 goto out;
569 ret = crypto_shash_update(shash, "HostHost", 8);
570 if (ret)
571 goto out;
572 ret = crypto_shash_update(shash, ctrl->opts->host->nqn,
573 strlen(ctrl->opts->host->nqn));
574 if (ret)
575 goto out;
576 ret = crypto_shash_update(shash, buf, 1);
577 if (ret)
578 goto out;
579 ret = crypto_shash_update(shash, ctrl->opts->subsysnqn,
580 strlen(ctrl->opts->subsysnqn));
581 if (ret)
582 goto out;
583 ret = crypto_shash_final(shash, chap->response);
584 out:
585 if (challenge != chap->c1)
586 kfree(challenge);
587 return ret;
588 }
589
590 int nvme_auth_dhchap_controller_response(struct nvme_ctrl *ctrl,
591 struct nvme_dhchap_context *chap)
592 {
593 SHASH_DESC_ON_STACK(shash, chap->shash_tfm);
594 u8 buf[4], *challenge = chap->c2;
595 int ret;
596
597 if (chap->dh_tfm) {
598 challenge = kmalloc(chap->hash_len, GFP_KERNEL);
599 if (!challenge) {
600 ret = -ENOMEM;
601 goto out;
602 }
603 ret = nvme_auth_augmented_challenge(chap, chap->c2,
604 challenge);
605 if (ret)
606 goto out;
607 }
608 dev_dbg(ctrl->device, "%s: qid %d host response seq %d transaction %d\n",
609 __func__, chap->qid, chap->s2, chap->transaction);
610 dev_dbg(ctrl->device, "%s: qid %d challenge %*ph\n",
611 __func__, chap->qid, chap->hash_len, challenge);
612 dev_dbg(ctrl->device, "%s: qid %d subsysnqn %s\n",
613 __func__, chap->qid, ctrl->opts->subsysnqn);
614 dev_dbg(ctrl->device, "%s: qid %d hostnqn %s\n",
615 __func__, chap->qid, ctrl->opts->host->nqn);
616 shash->tfm = chap->shash_tfm;
617 ret = crypto_shash_init(shash);
618 if (ret)
619 goto out;
620 ret = crypto_shash_update(shash, challenge, chap->hash_len);
621 if (ret)
622 goto out;
623 put_unaligned_le32(chap->s2, buf);
624 ret = crypto_shash_update(shash, buf, 4);
625 if (ret)
626 goto out;
627 put_unaligned_le16(chap->transaction, buf);
628 ret = crypto_shash_update(shash, buf, 2);
629 if (ret)
630 goto out;
631 memset(buf, 0, 4);
632 ret = crypto_shash_update(shash, buf, 1);
633 if (ret)
634 goto out;
635 ret = crypto_shash_update(shash, "Controller", 10);
636 if (ret)
637 goto out;
638 ret = crypto_shash_update(shash, ctrl->opts->subsysnqn,
639 strlen(ctrl->opts->subsysnqn));
640 if (ret)
641 goto out;
642 ret = crypto_shash_update(shash, buf, 1);
643 if (ret)
644 goto out;
645 ret = crypto_shash_update(shash, ctrl->opts->host->nqn,
646 strlen(ctrl->opts->host->nqn));
647 if (ret)
648 goto out;
649 ret = crypto_shash_final(shash, chap->response);
650 out:
651 if (challenge != chap->c2)
652 kfree(challenge);
653 return ret;
654 }
655
656 int nvme_auth_generate_key(struct nvme_ctrl *ctrl,
657 struct nvme_dhchap_context *chap)
658 {
659 size_t dhchap_len = strlen(ctrl->opts->dhchap_secret) - 11;
660 u8 *decoded_key;
661 size_t decoded_len;
662 u32 crc;
663
664 if (memcmp(ctrl->opts->dhchap_secret, "DHHC-1:00:", 10))
665 return -EINVAL;
666
667 decoded_key = kzalloc(dhchap_len, GFP_KERNEL);
668 if (!decoded_key)
669 return -ENOMEM;
670 decoded_len = base64_decode(ctrl->opts->dhchap_secret + 10,
671 dhchap_len, decoded_key);
672 if (decoded_len != 36 && decoded_len != 52 && decoded_len != 68) {
673 dev_warn(ctrl->dev,
674 "DH-HMAC-CHAP: unsupported key length %zu\n", dhchap_len);
675 return -EKEYREJECTED;
676 }
677 /* The last four bytes is the CRC in little-endian format */
678 decoded_len -= 4;
679 crc = ~crc32(~0, decoded_key, decoded_len);
680
681 if (get_unaligned_le32(decoded_key + decoded_len) != crc) {
682 dev_warn(ctrl->dev,
683 "DH-HMAC-CHAP: key crc mismatch! (%u != %u)\n",
684 get_unaligned_le32(decoded_key + decoded_len), crc);
685 }
686 memcpy(chap->key, decoded_key, decoded_len);
687 kfree(decoded_key);
688 return 0;
689 }
690
> 691 int nvme_auth_dhchap_exponential(struct nvme_ctrl *ctrl,
692 struct nvme_dhchap_context *chap)
693 {
694 struct kpp_request *req;
695 struct crypto_wait wait;
696 struct scatterlist src, dst;
697 u8 *pkey;
698 int ret, pkey_len;
699
700 if (chap->dhgroup_id == NVME_AUTH_DHCHAP_DHGROUP_ECDH) {
701 struct ecdh p = {0};
702
703 pkey_len = crypto_ecdh_key_len(&p);
704 pkey = kzalloc(pkey_len, GFP_KERNEL);
705 if (!pkey)
706 return -ENOMEM;
707
708 get_random_bytes(pkey, pkey_len);
709 ret = crypto_ecdh_encode_key(pkey, pkey_len, &p);
710 if (ret) {
711 dev_dbg(ctrl->device,
712 "failed to encode pkey, error %d\n", ret);
713 kfree(pkey);
714 return ret;
715 }
716 chap->host_key_len = 64;
717 chap->sess_key_len = 32;
718 } else if (chap->dhgroup_id == NVME_AUTH_DHCHAP_DHGROUP_25519) {
719 pkey_len = CURVE25519_KEY_SIZE;
720 pkey = kzalloc(pkey_len, GFP_KERNEL);
721 if (!pkey)
722 return -ENOMEM;
723 get_random_bytes(pkey, pkey_len);
724 chap->host_key_len = chap->sess_key_len = CURVE25519_KEY_SIZE;
725 } else {
726 dev_warn(ctrl->device, "Invalid DH group id %d\n",
727 chap->dhgroup_id);
728 chap->status = NVME_AUTH_DHCHAP_FAILURE_INVALID_PAYLOAD;
729 return -EINVAL;
730 }
731
732 ret = crypto_kpp_set_secret(chap->dh_tfm, pkey, pkey_len);
733 if (ret) {
734 dev_dbg(ctrl->dev, "failed to set secret, error %d\n", ret);
735 kfree(pkey);
736 return ret;
737 }
738 req = kpp_request_alloc(chap->dh_tfm, GFP_KERNEL);
739 if (!req) {
740 ret = -ENOMEM;
741 goto out_free_exp;
742 }
743
744 chap->host_key = kzalloc(chap->host_key_len, GFP_KERNEL);
745 if (!chap->host_key) {
746 ret = -ENOMEM;
747 goto out_free_req;
748 }
749 crypto_init_wait(&wait);
750 kpp_request_set_input(req, NULL, 0);
751 sg_init_one(&dst, chap->host_key, chap->host_key_len);
752 kpp_request_set_output(req, &dst, chap->host_key_len);
753 kpp_request_set_callback(req, CRYPTO_TFM_REQ_MAY_BACKLOG,
754 crypto_req_done, &wait);
755
756 ret = crypto_wait_req(crypto_kpp_generate_public_key(req), &wait);
757 if (ret) {
758 dev_dbg(ctrl->dev,
759 "failed to generate public key, error %d\n", ret);
760 goto out_free_host;
761 }
762
763 chap->sess_key = kmalloc(chap->sess_key_len, GFP_KERNEL);
764 if (!chap->sess_key)
765 goto out_free_host;
766
767 crypto_init_wait(&wait);
768 sg_init_one(&src, chap->ctrl_key, chap->ctrl_key_len);
769 kpp_request_set_input(req, &src, chap->ctrl_key_len);
770 sg_init_one(&dst, chap->sess_key, chap->sess_key_len);
771 kpp_request_set_output(req, &dst, chap->sess_key_len);
772 kpp_request_set_callback(req, CRYPTO_TFM_REQ_MAY_BACKLOG,
773 crypto_req_done, &wait);
774
775 ret = crypto_wait_req(crypto_kpp_compute_shared_secret(req), &wait);
776 if (ret) {
777 dev_dbg(ctrl->dev,
778 "failed to generate shared secret, error %d\n", ret);
779 kfree_sensitive(chap->sess_key);
780 chap->sess_key = NULL;
781 chap->sess_key_len = 0;
782 } else
783 dev_dbg(ctrl->dev, "shared secret %*ph\n",
784 (int)chap->sess_key_len, chap->sess_key);
785 out_free_host:
786 if (ret) {
787 kfree(chap->host_key);
788 chap->host_key = NULL;
789 chap->host_key_len = 0;
790 }
791 out_free_req:
792 kpp_request_free(req);
793 out_free_exp:
794 kfree_sensitive(pkey);
795 if (ret)
796 chap->status = NVME_AUTH_DHCHAP_FAILURE_INVALID_PAYLOAD;
797 return ret;
798 }
799
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 2 months
Re: [PATCH v4 6/8] phy: HiSilicon: add driver for Kirin 970 PCIe PHY
by kernel test robot
Hi Mauro,
I love your patch! Perhaps something to improve:
[auto build test WARNING on pci/next]
[also build test WARNING on robh/for-next linus/master v5.14-rc1 next-20210712]
[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/Mauro-Carvalho-Chehab/Add-suppor...
base: https://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git next
config: sh-allmodconfig (attached as .config)
compiler: sh4-linux-gcc (GCC) 9.3.0
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/c1d16aeb1efc7e49da9c7222fc98efcc0...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Mauro-Carvalho-Chehab/Add-support-for-Hikey-970-PCIe/20210713-054716
git checkout c1d16aeb1efc7e49da9c7222fc98efcc07ddb5c3
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=sh
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
>> drivers/phy/hisilicon/phy-hi3670-pcie.c:178:6: warning: no previous prototype for 'hi3670_pcie_get_eyeparam' [-Wmissing-prototypes]
178 | void hi3670_pcie_get_eyeparam(struct hi3670_pcie_phy *phy)
| ^~~~~~~~~~~~~~~~~~~~~~~~
Kconfig warnings: (for reference only)
WARNING: unmet direct dependencies detected for SND_ATMEL_SOC_PDC
Depends on SOUND && !UML && SND && SND_SOC && SND_ATMEL_SOC && HAS_DMA
Selected by
- SND_ATMEL_SOC_SSC && SOUND && !UML && SND && SND_SOC && SND_ATMEL_SOC
- SND_ATMEL_SOC_SSC_PDC && SOUND && !UML && SND && SND_SOC && SND_ATMEL_SOC && ATMEL_SSC
vim +/hi3670_pcie_get_eyeparam +178 drivers/phy/hisilicon/phy-hi3670-pcie.c
177
> 178 void hi3670_pcie_get_eyeparam(struct hi3670_pcie_phy *phy)
179 {
180 struct device *dev = phy->dev;
181 struct device_node *np;
182 int ret, i;
183
184 np = dev->of_node;
185
186 ret = of_property_read_u32_array(np, "hisilicon,eye-diagram-param",
187 phy->eye_param, NUM_EYEPARAM);
188 if (!ret)
189 return;
190
191 /* There's no optional eye_param property. Set array to default */
192 for (i = 0; i < NUM_EYEPARAM; i++)
193 phy->eye_param[i] = EYEPARAM_NOCFG;
194 }
195
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 2 months
[chrome-os:chromeos-5.4 2/4] kernel/sched/core.c:8178:25: warning: equality comparison with extraneous parentheses
by kernel test robot
tree: https://chromium.googlesource.com/chromiumos/third_party/kernel chromeos-5.4
head: c259747b4f3c520a2cd6fff8fbed5f63355ce07f
commit: 0fe13b0a941b5e6adc57431cc380cef82dde314c [2/4] FIXUP: CHROMIUM: sched: Add a per-thread core scheduling interface
config: x86_64-randconfig-a014-20210712 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 8d69635ed9ecf36fd0ca85906bfde17949671cbe)
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 x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
git remote add chrome-os https://chromium.googlesource.com/chromiumos/third_party/kernel
git fetch --no-tags chrome-os chromeos-5.4
git checkout 0fe13b0a941b5e6adc57431cc380cef82dde314c
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
kernel/sched/core.c:2725:6: warning: no previous prototype for function 'sched_set_stop_task' [-Wmissing-prototypes]
void sched_set_stop_task(int cpu, struct task_struct *stop)
^
kernel/sched/core.c:2725:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
void sched_set_stop_task(int cpu, struct task_struct *stop)
^
static
kernel/sched/core.c:5387:35: warning: no previous prototype for function 'schedule_user' [-Wmissing-prototypes]
asmlinkage __visible void __sched schedule_user(void)
^
kernel/sched/core.c:5387:22: note: declare 'static' if the function is not intended to be used outside of this translation unit
asmlinkage __visible void __sched schedule_user(void)
^
static
>> kernel/sched/core.c:8178:25: warning: equality comparison with extraneous parentheses [-Wparentheses-equality]
if ((tsk->core_cookie == (unsigned long)tsk)
~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
kernel/sched/core.c:8178:25: note: remove extraneous parentheses around the comparison to silence this warning
if ((tsk->core_cookie == (unsigned long)tsk)
~ ^ ~
kernel/sched/core.c:8178:25: note: use '=' to turn this equality comparison into an assignment
if ((tsk->core_cookie == (unsigned long)tsk)
^~
=
kernel/sched/core.c:1249:28: warning: unused function 'uclamp_bucket_base_value' [-Wunused-function]
static inline unsigned int uclamp_bucket_base_value(unsigned int clamp_value)
^
kernel/sched/core.c:1592:1: warning: unused function 'uclamp_update_active' [-Wunused-function]
uclamp_update_active(struct task_struct *p, enum uclamp_id clamp_id)
^
5 warnings generated.
vim +8178 kernel/sched/core.c
8148
8149 int task_set_core_sched(int set, struct task_struct *tsk,
8150 unsigned long cookie)
8151 {
8152 if (!tsk)
8153 tsk = current;
8154
8155 if (set != 0 && set != 1)
8156 return -ERANGE;
8157
8158 if (!static_branch_likely(&sched_smt_present))
8159 return -EINVAL;
8160
8161 if (!sched_feat(CORE_PRCTL))
8162 return -ENOSYS;
8163
8164 if (set == 0 && !capable(CAP_SYS_ADMIN))
8165 return -EPERM;
8166
8167 /*
8168 * If cookie was set previously, return -EBUSY if either of the
8169 * following are true:
8170 * 1. Task was previously tagged by CGroup method.
8171 * 2. Task or its parent were tagged by prctl().
8172 *
8173 * Note that, if CGroup tagging is done after prctl(), then that would
8174 * override the cookie. However, if prctl() is done after task was
8175 * added to tagged CGroup, then the prctl() returns -EBUSY.
8176 */
8177 if (!!tsk->core_cookie == set) {
> 8178 if ((tsk->core_cookie == (unsigned long)tsk)
8179 #ifdef CONFIG_CGROUP_SCHED
8180 || tsk->core_cookie == (unsigned long)tsk->sched_task_group
8181 #endif
8182 ) {
8183 return -EBUSY;
8184 }
8185 }
8186
8187 if (set)
8188 sched_core_get();
8189
8190 if (cookie)
8191 tsk->core_cookie = cookie;
8192 else
8193 tsk->core_cookie = set ? (unsigned long)tsk : 0;
8194
8195 stop_machine(task_set_core_sched_stopper, (void *)tsk, NULL);
8196
8197 if (!set)
8198 sched_core_put();
8199 return 0;
8200 }
8201 #endif
8202
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 2 months