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>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202412162242.yQ3MVnZ5-lkp@intel.com>
Date: Mon, 16 Dec 2024 22:25:54 +0800
From: kernel test robot <lkp@...el.com>
To: Michael Chan <michael.chan@...adcom.com>, davem@...emloft.net
Cc: llvm@...ts.linux.dev, oe-kbuild-all@...ts.linux.dev,
	netdev@...r.kernel.org, edumazet@...gle.com, kuba@...nel.org,
	pabeni@...hat.com, andrew+netdev@...n.ch, pavan.chebbi@...adcom.com,
	andrew.gospodarek@...adcom.com,
	Kalesh AP <kalesh-anakkur.purayil@...adcom.com>
Subject: Re: [PATCH net-next 2/6] bnxt_en: Do not allow ethtool -m on an
 untrusted VF

Hi Michael,

kernel test robot noticed the following build warnings:

[auto build test WARNING on net-next/main]

url:    https://github.com/intel-lab-lkp/linux/commits/Michael-Chan/bnxt_en-Use-FW-defined-resource-limits-for-RoCE/20241216-050303
base:   net-next/main
patch link:    https://lore.kernel.org/r/20241215205943.2341612-3-michael.chan%40broadcom.com
patch subject: [PATCH net-next 2/6] bnxt_en: Do not allow ethtool -m on an untrusted VF
config: riscv-randconfig-002-20241216 (https://download.01.org/0day-ci/archive/20241216/202412162242.yQ3MVnZ5-lkp@intel.com/config)
compiler: clang version 15.0.7 (https://github.com/llvm/llvm-project 8dfdcc7b7bf66834a761bd8de445840ef68e4d1a)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241216/202412162242.yQ3MVnZ5-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@...el.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202412162242.yQ3MVnZ5-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> drivers/net/ethernet/broadcom/bnxt/bnxt.c:8287:7: warning: variable 'flags' is uninitialized when used here [-Wuninitialized]
                   if (flags & FUNC_QCFG_RESP_FLAGS_TRUSTED_VF)
                       ^~~~~
   drivers/net/ethernet/broadcom/bnxt/bnxt.c:8269:11: note: initialize the variable 'flags' to silence this warning
           u16 flags;
                    ^
                     = 0
   1 warning generated.


vim +/flags +8287 drivers/net/ethernet/broadcom/bnxt/bnxt.c

  8264	
  8265	static int bnxt_hwrm_func_qcfg(struct bnxt *bp)
  8266	{
  8267		struct hwrm_func_qcfg_output *resp;
  8268		struct hwrm_func_qcfg_input *req;
  8269		u16 flags;
  8270		int rc;
  8271	
  8272		rc = hwrm_req_init(bp, req, HWRM_FUNC_QCFG);
  8273		if (rc)
  8274			return rc;
  8275	
  8276		req->fid = cpu_to_le16(0xffff);
  8277		resp = hwrm_req_hold(bp, req);
  8278		rc = hwrm_req_send(bp, req);
  8279		if (rc)
  8280			goto func_qcfg_exit;
  8281	
  8282	#ifdef CONFIG_BNXT_SRIOV
  8283		if (BNXT_VF(bp)) {
  8284			struct bnxt_vf_info *vf = &bp->vf;
  8285	
  8286			vf->vlan = le16_to_cpu(resp->vlan) & VLAN_VID_MASK;
> 8287			if (flags & FUNC_QCFG_RESP_FLAGS_TRUSTED_VF)
  8288				vf->flags |= BNXT_VF_TRUST;
  8289			else
  8290				vf->flags &= ~BNXT_VF_TRUST;
  8291		} else {
  8292			bp->pf.registered_vfs = le16_to_cpu(resp->registered_vfs);
  8293		}
  8294	#endif
  8295		flags = le16_to_cpu(resp->flags);
  8296		if (flags & (FUNC_QCFG_RESP_FLAGS_FW_DCBX_AGENT_ENABLED |
  8297			     FUNC_QCFG_RESP_FLAGS_FW_LLDP_AGENT_ENABLED)) {
  8298			bp->fw_cap |= BNXT_FW_CAP_LLDP_AGENT;
  8299			if (flags & FUNC_QCFG_RESP_FLAGS_FW_DCBX_AGENT_ENABLED)
  8300				bp->fw_cap |= BNXT_FW_CAP_DCBX_AGENT;
  8301		}
  8302		if (BNXT_PF(bp) && (flags & FUNC_QCFG_RESP_FLAGS_MULTI_HOST))
  8303			bp->flags |= BNXT_FLAG_MULTI_HOST;
  8304	
  8305		if (flags & FUNC_QCFG_RESP_FLAGS_RING_MONITOR_ENABLED)
  8306			bp->fw_cap |= BNXT_FW_CAP_RING_MONITOR;
  8307	
  8308		if (flags & FUNC_QCFG_RESP_FLAGS_ENABLE_RDMA_SRIOV)
  8309			bp->fw_cap |= BNXT_FW_CAP_ENABLE_RDMA_SRIOV;
  8310	
  8311		switch (resp->port_partition_type) {
  8312		case FUNC_QCFG_RESP_PORT_PARTITION_TYPE_NPAR1_0:
  8313		case FUNC_QCFG_RESP_PORT_PARTITION_TYPE_NPAR1_5:
  8314		case FUNC_QCFG_RESP_PORT_PARTITION_TYPE_NPAR2_0:
  8315			bp->port_partition_type = resp->port_partition_type;
  8316			break;
  8317		}
  8318		if (bp->hwrm_spec_code < 0x10707 ||
  8319		    resp->evb_mode == FUNC_QCFG_RESP_EVB_MODE_VEB)
  8320			bp->br_mode = BRIDGE_MODE_VEB;
  8321		else if (resp->evb_mode == FUNC_QCFG_RESP_EVB_MODE_VEPA)
  8322			bp->br_mode = BRIDGE_MODE_VEPA;
  8323		else
  8324			bp->br_mode = BRIDGE_MODE_UNDEF;
  8325	
  8326		bp->max_mtu = le16_to_cpu(resp->max_mtu_configured);
  8327		if (!bp->max_mtu)
  8328			bp->max_mtu = BNXT_MAX_MTU;
  8329	
  8330		if (bp->db_size)
  8331			goto func_qcfg_exit;
  8332	
  8333		bp->db_offset = le16_to_cpu(resp->legacy_l2_db_size_kb) * 1024;
  8334		if (BNXT_CHIP_P5(bp)) {
  8335			if (BNXT_PF(bp))
  8336				bp->db_offset = DB_PF_OFFSET_P5;
  8337			else
  8338				bp->db_offset = DB_VF_OFFSET_P5;
  8339		}
  8340		bp->db_size = PAGE_ALIGN(le16_to_cpu(resp->l2_doorbell_bar_size_kb) *
  8341					 1024);
  8342		if (!bp->db_size || bp->db_size > pci_resource_len(bp->pdev, 2) ||
  8343		    bp->db_size <= bp->db_offset)
  8344			bp->db_size = pci_resource_len(bp->pdev, 2);
  8345	
  8346	func_qcfg_exit:
  8347		hwrm_req_drop(bp, req);
  8348		return rc;
  8349	}
  8350	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ