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: <202209111637.zSGjIXwb-lkp@intel.com>
Date:   Tue, 13 Sep 2022 12:27:25 +0300
From:   Dan Carpenter <dan.carpenter@...cle.com>
To:     kbuild@...ts.01.org, Yevhen Orlov <yevhen.orlov@...ision.eu>,
        netdev@...r.kernel.org
Cc:     lkp@...el.com, kbuild-all@...ts.01.org,
        Volodymyr Mytnyk <volodymyr.mytnyk@...ision.eu>,
        Taras Chornyi <taras.chornyi@...ision.eu>,
        Mickey Rachamim <mickeyr@...vell.com>,
        Serhiy Pshyk <serhiy.pshyk@...ision.eu>,
        "David S . Miller" <davem@...emloft.net>,
        Eric Dumazet <edumazet@...gle.com>,
        Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>, Andrew Lunn <andrew@...n.ch>,
        Stephen Hemminger <stephen@...workplumber.org>,
        linux-kernel@...r.kernel.org,
        Yevhen Orlov <yevhen.orlov@...ision.eu>,
        Oleksandr Mazur <oleksandr.mazur@...ision.eu>
Subject: Re: [PATCH net-next v5 8/9] net: marvell: prestera: Add neighbour
 cache accounting

Hi Yevhen,

url:    https://github.com/intel-lab-lkp/linux/commits/Yevhen-Orlov/net-marvell-prestera-add-nexthop-routes-offloading/20220909-065815
base:   https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git 9f8f1933dce555d3c246f447f54fca8de8889da9
config: openrisc-randconfig-m041-20220907
compiler: or1k-linux-gcc (GCC) 12.1.0

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@...el.com>
Reported-by: Dan Carpenter <dan.carpenter@...cle.com>

smatch warnings:
drivers/net/ethernet/marvell/prestera/prestera_router.c:751 __prestera_k_arb_n_lpm_set() error: uninitialized symbol 'fib_node'.

vim +/fib_node +751 drivers/net/ethernet/marvell/prestera/prestera_router.c

5a826d874f2b0e Yevhen Orlov 2022-09-09  715  static void
5a826d874f2b0e Yevhen Orlov 2022-09-09  716  __prestera_k_arb_n_lpm_set(struct prestera_switch *sw,
5a826d874f2b0e Yevhen Orlov 2022-09-09  717  			   struct prestera_kern_neigh_cache *n_cache,
5a826d874f2b0e Yevhen Orlov 2022-09-09  718  			   bool enabled)
5a826d874f2b0e Yevhen Orlov 2022-09-09  719  {
5a826d874f2b0e Yevhen Orlov 2022-09-09  720  	struct prestera_nexthop_group_key nh_grp_key;
5a826d874f2b0e Yevhen Orlov 2022-09-09  721  	struct prestera_kern_fib_cache_key fc_key;
5a826d874f2b0e Yevhen Orlov 2022-09-09  722  	struct prestera_kern_fib_cache *fib_cache;
5a826d874f2b0e Yevhen Orlov 2022-09-09  723  	struct prestera_fib_node *fib_node;
5a826d874f2b0e Yevhen Orlov 2022-09-09  724  	struct prestera_fib_key fib_key;
5a826d874f2b0e Yevhen Orlov 2022-09-09  725  
5a826d874f2b0e Yevhen Orlov 2022-09-09  726  	/* Exception for fc with prefix 32: LPM entry is already used by fib */
5a826d874f2b0e Yevhen Orlov 2022-09-09  727  	memset(&fc_key, 0, sizeof(fc_key));
5a826d874f2b0e Yevhen Orlov 2022-09-09  728  	fc_key.addr = n_cache->key.addr;
5a826d874f2b0e Yevhen Orlov 2022-09-09  729  	fc_key.prefix_len = PRESTERA_IP_ADDR_PLEN(n_cache->key.addr.v);
5a826d874f2b0e Yevhen Orlov 2022-09-09  730  	/* But better to use tb_id of route, which pointed to this neighbour. */
5a826d874f2b0e Yevhen Orlov 2022-09-09  731  	/* We take it from rif, because rif inconsistent.
5a826d874f2b0e Yevhen Orlov 2022-09-09  732  	 * Must be separated in_rif and out_rif.
5a826d874f2b0e Yevhen Orlov 2022-09-09  733  	 * Also note: for each fib pointed to this neigh should be separated
5a826d874f2b0e Yevhen Orlov 2022-09-09  734  	 *            neigh lpm entry (for each ingress vr)
5a826d874f2b0e Yevhen Orlov 2022-09-09  735  	 */
5a826d874f2b0e Yevhen Orlov 2022-09-09  736  	fc_key.kern_tb_id = l3mdev_fib_table(n_cache->key.dev);
5a826d874f2b0e Yevhen Orlov 2022-09-09  737  	fib_cache = prestera_kern_fib_cache_find(sw, &fc_key);
5a826d874f2b0e Yevhen Orlov 2022-09-09  738  	if (!fib_cache || !fib_cache->reachable) {
5a826d874f2b0e Yevhen Orlov 2022-09-09  739  		memset(&fib_key, 0, sizeof(fib_key));
5a826d874f2b0e Yevhen Orlov 2022-09-09  740  		fib_key.addr = n_cache->key.addr;
5a826d874f2b0e Yevhen Orlov 2022-09-09  741  		fib_key.prefix_len = PRESTERA_IP_ADDR_PLEN(n_cache->key.addr.v);
5a826d874f2b0e Yevhen Orlov 2022-09-09  742  		fib_key.tb_id = prestera_fix_tb_id(fc_key.kern_tb_id);
5a826d874f2b0e Yevhen Orlov 2022-09-09  743  		fib_node = prestera_fib_node_find(sw, &fib_key);
5a826d874f2b0e Yevhen Orlov 2022-09-09  744  		if (!enabled && fib_node) {
5a826d874f2b0e Yevhen Orlov 2022-09-09  745  			if (prestera_fib_node_util_is_neighbour(fib_node))
5a826d874f2b0e Yevhen Orlov 2022-09-09  746  				prestera_fib_node_destroy(sw, fib_node);
5a826d874f2b0e Yevhen Orlov 2022-09-09  747  			return;
5a826d874f2b0e Yevhen Orlov 2022-09-09  748  		}
5a826d874f2b0e Yevhen Orlov 2022-09-09  749  	}

fib_node not initialized on else path.

5a826d874f2b0e Yevhen Orlov 2022-09-09  750  
5a826d874f2b0e Yevhen Orlov 2022-09-09 @751  	if (enabled && !fib_node) {
5a826d874f2b0e Yevhen Orlov 2022-09-09  752  		memset(&nh_grp_key, 0, sizeof(nh_grp_key));
5a826d874f2b0e Yevhen Orlov 2022-09-09  753  		prestera_util_nc_key2nh_key(&n_cache->key,
5a826d874f2b0e Yevhen Orlov 2022-09-09  754  					    &nh_grp_key.neigh[0]);
5a826d874f2b0e Yevhen Orlov 2022-09-09  755  		fib_node = prestera_fib_node_create(sw, &fib_key,
5a826d874f2b0e Yevhen Orlov 2022-09-09  756  						    PRESTERA_FIB_TYPE_UC_NH,
5a826d874f2b0e Yevhen Orlov 2022-09-09  757  						    &nh_grp_key);
5a826d874f2b0e Yevhen Orlov 2022-09-09  758  		if (!fib_node)
5a826d874f2b0e Yevhen Orlov 2022-09-09  759  			pr_err("%s failed ip=%pI4n", "prestera_fib_node_create",
5a826d874f2b0e Yevhen Orlov 2022-09-09  760  			       &fib_key.addr.u.ipv4);
5a826d874f2b0e Yevhen Orlov 2022-09-09  761  		return;
5a826d874f2b0e Yevhen Orlov 2022-09-09  762  	}
5a826d874f2b0e Yevhen Orlov 2022-09-09  763  }

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ