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: <202107231446.1pJe2j76-lkp@intel.com>
Date:   Fri, 23 Jul 2021 14:24:54 +0800
From:   kernel test robot <lkp@...el.com>
To:     Christina Jacob <cjacob@...vell.com>
Cc:     kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org,
        Sunil Goutham <sgoutham@...vell.com>,
        Hariprasad Kelam <hkelam@...vell.com>,
        Jesse Brandeburg <jesse.brandeburg@...el.com>
Subject: drivers/net/ethernet/marvell/octeontx2/nic/otx2_ethtool.c:951
 otx2_get_fecparam() warn: always true condition '(pfvf->linfo.fec < 4) =>
 (0-3 < 4)'

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   8baef6386baaefb776bdd09b5c7630cf057c51c6
commit: d0cf9503e908ee7b235a5efecedeb74aabc482f3 octeontx2-pf: ethtool fec mode support
date:   5 months ago
config: ia64-randconfig-m031-20210723 (attached as .config)
compiler: ia64-linux-gcc (GCC) 10.3.0

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

New smatch warnings:
drivers/net/ethernet/marvell/octeontx2/nic/otx2_ethtool.c:951 otx2_get_fecparam() warn: always true condition '(pfvf->linfo.fec < 4) => (0-3 < 4)'

Old smatch warnings:
drivers/net/ethernet/marvell/octeontx2/nic/otx2_ethtool.c:962 otx2_get_fecparam() error: buffer overflow 'fec' 4 <= 4

vim +951 drivers/net/ethernet/marvell/octeontx2/nic/otx2_ethtool.c

   939	
   940	static int otx2_get_fecparam(struct net_device *netdev,
   941				     struct ethtool_fecparam *fecparam)
   942	{
   943		struct otx2_nic *pfvf = netdev_priv(netdev);
   944		struct cgx_fw_data *rsp;
   945		const int fec[] = {
   946			ETHTOOL_FEC_OFF,
   947			ETHTOOL_FEC_BASER,
   948			ETHTOOL_FEC_RS,
   949			ETHTOOL_FEC_BASER | ETHTOOL_FEC_RS};
   950	#define FEC_MAX_INDEX 4
 > 951		if (pfvf->linfo.fec < FEC_MAX_INDEX)
   952			fecparam->active_fec = fec[pfvf->linfo.fec];
   953	
   954		rsp = otx2_get_fwdata(pfvf);
   955		if (IS_ERR(rsp))
   956			return PTR_ERR(rsp);
   957	
   958		if (rsp->fwdata.supported_fec <= FEC_MAX_INDEX) {
   959			if (!rsp->fwdata.supported_fec)
   960				fecparam->fec = ETHTOOL_FEC_NONE;
   961			else
   962				fecparam->fec = fec[rsp->fwdata.supported_fec];
   963		}
   964		return 0;
   965	}
   966	

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

Download attachment ".config.gz" of type "application/gzip" (33203 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ