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: <202410220908.uFiUPMGy-lkp@intel.com>
Date: Tue, 22 Oct 2024 10:18:35 +0800
From: kernel test robot <lkp@...el.com>
To: Pawel Dembicki <paweldembicki@...il.com>, netdev@...r.kernel.org
Cc: llvm@...ts.linux.dev, oe-kbuild-all@...ts.linux.dev,
	Linus Walleij <linus.walleij@...aro.org>,
	Pawel Dembicki <paweldembicki@...il.com>,
	Andrew Lunn <andrew@...n.ch>,
	Florian Fainelli <f.fainelli@...il.com>,
	Vladimir Oltean <olteanv@...il.com>,
	Eric Dumazet <edumazet@...gle.com>,
	Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH net-next 2/3] net: dsa: vsc73xx: implement packet
 reception via control interface

Hi Pawel,

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/Pawel-Dembicki/net-dsa-vsc73xx-implement-packet-reception-via-control-interface/20241021-050041
base:   net-next/main
patch link:    https://lore.kernel.org/r/20241020205452.2660042-2-paweldembicki%40gmail.com
patch subject: [PATCH net-next 2/3] net: dsa: vsc73xx: implement packet reception via control interface
config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20241022/202410220908.uFiUPMGy-lkp@intel.com/config)
compiler: clang version 18.1.8 (https://github.com/llvm/llvm-project 3b5b5c1ec4a3095ab096dd780e84d7ab81f3d7ff)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241022/202410220908.uFiUPMGy-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/202410220908.uFiUPMGy-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> drivers/net/dsa/vitesse-vsc73xx-core.c:935:30: warning: variable 'len' is uninitialized when used here [-Wuninitialized]
     935 |         skb = netdev_alloc_skb(dev, len);
         |                                     ^~~
   drivers/net/dsa/vitesse-vsc73xx-core.c:885:23: note: initialize the variable 'len' to silence this warning
     885 |         int ret, buf_len, len, part;
         |                              ^
         |                               = 0
   1 warning generated.


vim +/len +935 drivers/net/dsa/vitesse-vsc73xx-core.c

   879	
   880	static void vsc73xx_polled_rcv(struct kthread_work *work)
   881	{
   882		struct vsc73xx *vsc = container_of(work, struct vsc73xx, dwork.work);
   883		u16 ptr = VSC73XX_CAPT_FRAME_DATA;
   884		struct dsa_switch *ds = vsc->ds;
   885		int ret, buf_len, len, part;
   886		struct vsc73xx_ifh ifh;
   887		struct net_device *dev;
   888		struct dsa_port *dp;
   889		struct sk_buff *skb;
   890		u32 val, *buf;
   891		u16 count;
   892	
   893		ret = vsc73xx_read(vsc, VSC73XX_BLOCK_SYSTEM, 0, VSC73XX_CAPCTRL, &val);
   894		if (ret)
   895			goto queue;
   896	
   897		if (!(val & VSC73XX_CAPCTRL_QUEUE0_READY))
   898			/* No frame to read */
   899			goto queue;
   900	
   901		/* Initialise reading */
   902		ret = vsc73xx_read(vsc, VSC73XX_BLOCK_CAPTURE, VSC73XX_BLOCK_CAPT_Q0,
   903				   VSC73XX_CAPT_CAPREADP, &val);
   904		if (ret)
   905			goto queue;
   906	
   907		/* Get internal frame header */
   908		ret = vsc73xx_read(vsc, VSC73XX_BLOCK_CAPTURE,
   909				   VSC73XX_BLOCK_CAPT_FRAME0, ptr++, &ifh.datah);
   910		if (ret)
   911			goto queue;
   912	
   913		ret = vsc73xx_read(vsc, VSC73XX_BLOCK_CAPTURE,
   914				   VSC73XX_BLOCK_CAPT_FRAME0, ptr++, &ifh.datal);
   915		if (ret)
   916			goto queue;
   917	
   918		if (ifh.magic != VSC73XX_IFH_MAGIC) {
   919			/* Something goes wrong with buffer. Reset capture block */
   920			vsc73xx_write(vsc, VSC73XX_BLOCK_CAPTURE,
   921				      VSC73XX_BLOCK_CAPT_RST, VSC73XX_CAPT_CAPRST, 1);
   922			goto queue;
   923		}
   924	
   925		if (!dsa_is_user_port(ds, ifh.port))
   926			goto release_frame;
   927	
   928		dp = dsa_to_port(ds, ifh.port);
   929		dev = dp->user;
   930		if (!dev)
   931			goto release_frame;
   932	
   933		count = (ifh.frame_length + 7 + VSC73XX_IFH_SIZE - ETH_FCS_LEN) >> 2;
   934	
 > 935		skb = netdev_alloc_skb(dev, len);
   936		if (unlikely(!skb)) {
   937			netdev_err(dev, "Unable to allocate sk_buff\n");
   938			goto release_frame;
   939		}
   940	
   941		buf_len = ifh.frame_length - ETH_FCS_LEN;
   942		buf = (u32 *)skb_put(skb, buf_len);
   943		len = 0;
   944		part = 0;
   945	
   946		while (ptr < count) {
   947			ret = vsc73xx_read(vsc, VSC73XX_BLOCK_CAPTURE,
   948					   VSC73XX_BLOCK_CAPT_FRAME0 + part, ptr++,
   949					   buf + len);
   950			if (ret)
   951				goto free_skb;
   952			len++;
   953			if (ptr > VSC73XX_CAPT_FRAME_DATA_MAX &&
   954			    count != VSC73XX_CAPT_FRAME_DATA_MAX) {
   955				ptr = VSC73XX_CAPT_FRAME_DATA;
   956				part++;
   957				count -= VSC73XX_CAPT_FRAME_DATA_MAX;
   958			}
   959		}
   960	
   961		/* Get FCS */
   962		ret = vsc73xx_read(vsc, VSC73XX_BLOCK_CAPTURE,
   963				   VSC73XX_BLOCK_CAPT_FRAME0, ptr++, &val);
   964		if (ret)
   965			goto free_skb;
   966	
   967		/* Everything we see on an interface that is in the HW bridge
   968		 * has already been forwarded.
   969		 */
   970		if (dp->bridge)
   971			skb->offload_fwd_mark = 1;
   972	
   973		skb->protocol = eth_type_trans(skb, dev);
   974	
   975		netif_rx(skb);
   976		goto release_frame;
   977	
   978	free_skb:
   979		kfree_skb(skb);
   980	release_frame:
   981		/* Release the frame from internal buffer */
   982		vsc73xx_write(vsc, VSC73XX_BLOCK_CAPTURE, VSC73XX_BLOCK_CAPT_Q0,
   983			      VSC73XX_CAPT_CAPREADP, 0);
   984	queue:
   985		kthread_queue_delayed_work(vsc->rcv_worker, &vsc->dwork,
   986					   msecs_to_jiffies(VSC73XX_RCV_POLL_INTERVAL));
   987	}
   988	

-- 
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