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: <202204250600.UokLwrwL-lkp@intel.com>
Date:   Mon, 25 Apr 2022 06:36:35 +0800
From:   kernel test robot <lkp@...el.com>
To:     Ingo Molnar <mingo@...nel.org>
Cc:     kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org
Subject: [mingo-tip:sched/headers 396/2579] net/ipv4/nexthop.c:3686:32:
 sparse: sparse: dereference of noderef expression

tree:   git://git.kernel.org/pub/scm/linux/kernel/git/mingo/tip.git sched/headers
head:   49e1ec6c70a6eb4b7de9250a455b8b63eb42afbe
commit: 8c7e5c008072b19524ab8d9e3555cef82962c3ce [396/2579] headers/uninline: Uninline multi-use function: rb_link_node() and rb_link_node_rcu()
config: i386-randconfig-s001 (https://download.01.org/0day-ci/archive/20220425/202204250600.UokLwrwL-lkp@intel.com/config)
compiler: gcc-11 (Debian 11.2.0-20) 11.2.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.4-dirty
        # https://git.kernel.org/pub/scm/linux/kernel/git/mingo/tip.git/commit/?id=8c7e5c008072b19524ab8d9e3555cef82962c3ce
        git remote add mingo-tip git://git.kernel.org/pub/scm/linux/kernel/git/mingo/tip.git
        git fetch --no-tags mingo-tip sched/headers
        git checkout 8c7e5c008072b19524ab8d9e3555cef82962c3ce
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=i386 SHELL=/bin/bash mm/ net/ipv4/

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 >>)
>> net/ipv4/nexthop.c:3686:32: sparse: sparse: dereference of noderef expression

vim +3686 net/ipv4/nexthop.c

e95f2592f633a3 Ido Schimmel 2020-11-04  3667  
56ad5ba344dea9 Ido Schimmel 2021-03-11  3668  void nexthop_bucket_set_hw_flags(struct net *net, u32 id, u16 bucket_index,
56ad5ba344dea9 Ido Schimmel 2021-03-11  3669  				 bool offload, bool trap)
56ad5ba344dea9 Ido Schimmel 2021-03-11  3670  {
56ad5ba344dea9 Ido Schimmel 2021-03-11  3671  	struct nh_res_table *res_table;
56ad5ba344dea9 Ido Schimmel 2021-03-11  3672  	struct nh_res_bucket *bucket;
56ad5ba344dea9 Ido Schimmel 2021-03-11  3673  	struct nexthop *nexthop;
56ad5ba344dea9 Ido Schimmel 2021-03-11  3674  	struct nh_group *nhg;
56ad5ba344dea9 Ido Schimmel 2021-03-11  3675  
56ad5ba344dea9 Ido Schimmel 2021-03-11  3676  	rcu_read_lock();
56ad5ba344dea9 Ido Schimmel 2021-03-11  3677  
56ad5ba344dea9 Ido Schimmel 2021-03-11  3678  	nexthop = nexthop_find_by_id(net, id);
56ad5ba344dea9 Ido Schimmel 2021-03-11  3679  	if (!nexthop || !nexthop->is_group)
56ad5ba344dea9 Ido Schimmel 2021-03-11  3680  		goto out;
56ad5ba344dea9 Ido Schimmel 2021-03-11  3681  
56ad5ba344dea9 Ido Schimmel 2021-03-11  3682  	nhg = rcu_dereference(nexthop->nh_grp);
56ad5ba344dea9 Ido Schimmel 2021-03-11  3683  	if (!nhg->resilient)
56ad5ba344dea9 Ido Schimmel 2021-03-11  3684  		goto out;
56ad5ba344dea9 Ido Schimmel 2021-03-11  3685  
56ad5ba344dea9 Ido Schimmel 2021-03-11 @3686  	if (bucket_index >= nhg->res_table->num_nh_buckets)
56ad5ba344dea9 Ido Schimmel 2021-03-11  3687  		goto out;
56ad5ba344dea9 Ido Schimmel 2021-03-11  3688  
56ad5ba344dea9 Ido Schimmel 2021-03-11  3689  	res_table = rcu_dereference(nhg->res_table);
56ad5ba344dea9 Ido Schimmel 2021-03-11  3690  	bucket = &res_table->nh_buckets[bucket_index];
56ad5ba344dea9 Ido Schimmel 2021-03-11  3691  	bucket->nh_flags &= ~(RTNH_F_OFFLOAD | RTNH_F_TRAP);
56ad5ba344dea9 Ido Schimmel 2021-03-11  3692  	if (offload)
56ad5ba344dea9 Ido Schimmel 2021-03-11  3693  		bucket->nh_flags |= RTNH_F_OFFLOAD;
56ad5ba344dea9 Ido Schimmel 2021-03-11  3694  	if (trap)
56ad5ba344dea9 Ido Schimmel 2021-03-11  3695  		bucket->nh_flags |= RTNH_F_TRAP;
56ad5ba344dea9 Ido Schimmel 2021-03-11  3696  
56ad5ba344dea9 Ido Schimmel 2021-03-11  3697  out:
56ad5ba344dea9 Ido Schimmel 2021-03-11  3698  	rcu_read_unlock();
56ad5ba344dea9 Ido Schimmel 2021-03-11  3699  }
56ad5ba344dea9 Ido Schimmel 2021-03-11  3700  EXPORT_SYMBOL(nexthop_bucket_set_hw_flags);
56ad5ba344dea9 Ido Schimmel 2021-03-11  3701  

:::::: The code at line 3686 was first introduced by commit
:::::: 56ad5ba344dea9c914331da8754f5ba7cede9941 nexthop: Allow setting "offload" and "trap" indication of nexthop buckets

:::::: TO: Ido Schimmel <idosch@...dia.com>
:::::: CC: David S. Miller <davem@...emloft.net>

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ