lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202202272008.yNSnSONs-lkp@intel.com>
Date:   Sun, 27 Feb 2022 20:54:06 +0800
From:   kernel test robot <lkp@...el.com>
To:     Hannes Reinecke <hare@...e.de>
Cc:     kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org
Subject: [hare-scsi-devel:tls-upcall.v2 157/159]
 drivers/nvme/host/tcp.c:659:3: sparse: sparse: symbol 'fes_status' was not
 declared. Should it be static?

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/hare/scsi-devel.git tls-upcall.v2
head:   21b520ae0b338bd30496feb1ca90a2820dab7a65
commit: 294875f63a598198387eda2c7f5fc00c3ac94b7a [157/159] nvme-tcp: decode c2h term PDU
config: x86_64-randconfig-s021 (https://download.01.org/0day-ci/archive/20220227/202202272008.yNSnSONs-lkp@intel.com/config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.4-dirty
        # https://git.kernel.org/pub/scm/linux/kernel/git/hare/scsi-devel.git/commit/?id=294875f63a598198387eda2c7f5fc00c3ac94b7a
        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 tls-upcall.v2
        git checkout 294875f63a598198387eda2c7f5fc00c3ac94b7a
        # save the config file to linux build tree
        mkdir build_dir
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=x86_64 SHELL=/bin/bash

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


sparse warnings: (new ones prefixed by >>)
>> drivers/nvme/host/tcp.c:659:3: sparse: sparse: symbol 'fes_status' was not declared. Should it be static?
>> drivers/nvme/host/tcp.c:678:38: sparse: sparse: restricted __le16 degrades to integer
>> drivers/nvme/host/tcp.c:686:21: sparse: sparse: restricted __le32 degrades to integer
   drivers/nvme/host/tcp.c:689:16: sparse: sparse: restricted __le16 degrades to integer
   drivers/nvme/host/tcp.c:690:16: sparse: sparse: restricted __le16 degrades to integer
   drivers/nvme/host/tcp.c:691:16: sparse: sparse: restricted __le16 degrades to integer

vim +/fes_status +659 drivers/nvme/host/tcp.c

   655	
   656	struct fes_status_map {
   657		enum nvme_tcp_fatal_error_status fes;
   658		const char *desc;
 > 659	} fes_status[] = {
   660		{ NVME_TCP_FES_INVALID_PDU_HDR, "invalid pdu header"},
   661		{ NVME_TCP_FES_PDU_SEQ_ERR, "pdu sequence error" },
   662		{ NVME_TCP_FES_HDR_DIGEST_ERR, "header digest error" },
   663		{ NVME_TCP_FES_DATA_OUT_OF_RANGE, "data transfer out of range" },
   664		{ NVME_TCP_FES_DATA_LIMIT_EXCEEDED, "data limit exceeded" },
   665		{ NVME_TCP_FES_UNSUPPORTED_PARAM, "unsupported parameter" },
   666	};
   667	
   668	static int nvme_tcp_handle_c2h_term(struct nvme_tcp_queue *queue,
   669			struct nvme_tcp_term_pdu *pdu)
   670	{
   671		struct nvme_tcp_hdr *ref_pdu;
   672		struct fes_status_map *map;
   673		const char *fes_desc = NULL;
   674		int i;
   675		u32 pdu_offset;
   676	
   677		for (i = 0; i < ARRAY_SIZE(fes_status); i++) {
 > 678			if (map[i].fes == pdu->fes) {
   679				fes_desc = map[i].desc;
   680				break;
   681			}
   682		}
   683		if (!fes_desc)
   684			fes_desc = "unknown fatal error status";
   685	
 > 686		if (pdu->hdr.plen > sizeof(struct nvme_tcp_term_pdu))
   687			ref_pdu = (struct nvme_tcp_hdr *)((u8 *)pdu + 1);
   688	
   689		if (pdu->fes == NVME_TCP_FES_INVALID_PDU_HDR ||
   690		    pdu->fes == NVME_TCP_FES_HDR_DIGEST_ERR ||
   691		    pdu->fes == NVME_TCP_FES_UNSUPPORTED_PARAM) {
   692			pdu_offset = le32_to_cpu(pdu->fei);
   693	
   694			dev_err(queue->ctrl->ctrl.device,
   695				"queue %d c2h term, %s, pdu type %u offset %u\n",
   696				nvme_tcp_queue_id(queue), fes_desc, ref_pdu->type, pdu_offset);
   697		} else
   698			dev_err(queue->ctrl->ctrl.device,
   699				"queue %d c2h term, %s, pdu type %u\n",
   700				nvme_tcp_queue_id(queue), fes_desc, ref_pdu->type);
   701	
   702		return -ECONNRESET;
   703	}
   704	

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ