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 for Android: free password hash cracker in your pocket
[<prev] [next>] [day] [month] [year] [list]
Date:   Mon, 21 Feb 2022 17:51:58 +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 400/2574] 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:   39e8a0edc8fae20758051dadf7846849edc18b88
commit: 1458e29daa7f391e80f5d3f837586c6df551c740 [400/2574] headers/uninline: Uninline multi-use function: rb_link_node() and rb_link_node_rcu()
config: x86_64-randconfig-s022-20220221 (https://download.01.org/0day-ci/archive/20220221/202202211705.vXSB551U-lkp@intel.com/config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.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=1458e29daa7f391e80f5d3f837586c6df551c740
        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 1458e29daa7f391e80f5d3f837586c6df551c740
        # save the config file to linux build tree
        mkdir build_dir
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=x86_64 SHELL=/bin/bash arch/x86/entry/vsyscall/ drivers/hwspinlock/ 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, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ