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]
Date:   Fri, 15 Jul 2022 09:55:11 +0800
From:   kernel test robot <yujie.liu@...el.com>
To:     Joanne Koong <joannelkoong@...il.com>,
        netdev <netdev@...r.kernel.org>
CC:     <kbuild-all@...ts.01.org>, Eric Dumazet <edumazet@...gle.com>,
        <kafai@...com>, Jakub Kicinski <kuba@...nel.org>,
        "David S . Miller" <davem@...emloft.net>,
        Paolo Abeni <pabeni@...hat.com>,
        Joanne Koong <joannelkoong@...il.com>
Subject: Re: [PATCH net-next v2 1/3] net: Add a bhash2 table hashed by port +
 address

Hi Joanne,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on net-next/master]

url:    https://github.com/intel-lab-lkp/linux/commits/Joanne-Koong/Add-a-second-bind-table-hashed-by-port-address/20220713-075808
base:   https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git 5022e221c98a609e0e5b0a73852c7e3d32f1c545
config: x86_64-rhel-8.3-rust (https://download.01.org/0day-ci/archive/20220714/202207142304.r7aVTnSg-lkp@intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 5e61b9c556267086ef9b743a0b57df302eef831b)
reproduce (this is a W=1 build):
         # https://github.com/intel-lab-lkp/linux/commit/2e20fc25bca52fbc786bbae312df56514c10798d
         git remote add linux-review https://github.com/intel-lab-lkp/linux
         git fetch --no-tags linux-review Joanne-Koong/Add-a-second-bind-table-hashed-by-port-address/20220713-075808
         git checkout 2e20fc25bca52fbc786bbae312df56514c10798d
         # save the config file
         mkdir build_dir && cp config build_dir/.config
         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <yujie.liu@...el.com>

All warnings (new ones prefixed by >>):

 >> net/ipv4/inet_hashtables.c:853:31: warning: variable 'head' set but not used [-Wunused-but-set-variable]
            struct inet_bind_hashbucket *head, *head2;
                                         ^
    1 warning generated.


vim +/head +853 net/ipv4/inet_hashtables.c

2e20fc25bca52f Joanne Koong 2022-07-12  849
2e20fc25bca52f Joanne Koong 2022-07-12  850  int inet_bhash2_update_saddr(struct inet_bind_hashbucket *prev_saddr, struct sock *sk)
2e20fc25bca52f Joanne Koong 2022-07-12  851  {
2e20fc25bca52f Joanne Koong 2022-07-12  852  	struct inet_hashinfo *hinfo = sk->sk_prot->h.hashinfo;
2e20fc25bca52f Joanne Koong 2022-07-12 @853  	struct inet_bind_hashbucket *head, *head2;
2e20fc25bca52f Joanne Koong 2022-07-12  854  	struct inet_bind2_bucket *tb2, *new_tb2;
2e20fc25bca52f Joanne Koong 2022-07-12  855  	int l3mdev = inet_sk_bound_l3mdev(sk);
2e20fc25bca52f Joanne Koong 2022-07-12  856  	int port = inet_sk(sk)->inet_num;
2e20fc25bca52f Joanne Koong 2022-07-12  857  	struct net *net = sock_net(sk);
2e20fc25bca52f Joanne Koong 2022-07-12  858
2e20fc25bca52f Joanne Koong 2022-07-12  859  	/* Allocate a bind2 bucket ahead of time to avoid permanently putting
2e20fc25bca52f Joanne Koong 2022-07-12  860  	 * the bhash2 table in an inconsistent state if a new tb2 bucket
2e20fc25bca52f Joanne Koong 2022-07-12  861  	 * allocation fails.
2e20fc25bca52f Joanne Koong 2022-07-12  862  	 */
2e20fc25bca52f Joanne Koong 2022-07-12  863  	new_tb2 = kmem_cache_alloc(hinfo->bind2_bucket_cachep, GFP_ATOMIC);
2e20fc25bca52f Joanne Koong 2022-07-12  864  	if (!new_tb2)
2e20fc25bca52f Joanne Koong 2022-07-12  865  		return -ENOMEM;
2e20fc25bca52f Joanne Koong 2022-07-12  866
2e20fc25bca52f Joanne Koong 2022-07-12  867  	head = &hinfo->bhash[inet_bhashfn(net, port,
2e20fc25bca52f Joanne Koong 2022-07-12  868  					  hinfo->bhash_size)];
2e20fc25bca52f Joanne Koong 2022-07-12  869  	head2 = inet_bhashfn_portaddr(hinfo, sk, net, port);
2e20fc25bca52f Joanne Koong 2022-07-12  870
2e20fc25bca52f Joanne Koong 2022-07-12  871  	spin_lock_bh(&prev_saddr->lock);
2e20fc25bca52f Joanne Koong 2022-07-12  872  	__sk_del_bind2_node(sk);
2e20fc25bca52f Joanne Koong 2022-07-12  873  	inet_bind2_bucket_destroy(hinfo->bind2_bucket_cachep,
2e20fc25bca52f Joanne Koong 2022-07-12  874  				  inet_csk(sk)->icsk_bind2_hash);
2e20fc25bca52f Joanne Koong 2022-07-12  875  	spin_unlock_bh(&prev_saddr->lock);
2e20fc25bca52f Joanne Koong 2022-07-12  876
2e20fc25bca52f Joanne Koong 2022-07-12  877  	spin_lock_bh(&head2->lock);
2e20fc25bca52f Joanne Koong 2022-07-12  878  	tb2 = inet_bind2_bucket_find(head2, net, port, l3mdev, sk);
2e20fc25bca52f Joanne Koong 2022-07-12  879  	if (!tb2) {
2e20fc25bca52f Joanne Koong 2022-07-12  880  		tb2 = new_tb2;
2e20fc25bca52f Joanne Koong 2022-07-12  881  		inet_bind2_bucket_init(tb2, net, head2, port, l3mdev, sk);
2e20fc25bca52f Joanne Koong 2022-07-12  882  	}
2e20fc25bca52f Joanne Koong 2022-07-12  883  	sk_add_bind2_node(sk, &tb2->owners);
2e20fc25bca52f Joanne Koong 2022-07-12  884  	inet_csk(sk)->icsk_bind2_hash = tb2;
2e20fc25bca52f Joanne Koong 2022-07-12  885  	spin_unlock_bh(&head2->lock);
2e20fc25bca52f Joanne Koong 2022-07-12  886
2e20fc25bca52f Joanne Koong 2022-07-12  887  	if (tb2 != new_tb2)
2e20fc25bca52f Joanne Koong 2022-07-12  888  		kmem_cache_free(hinfo->bind2_bucket_cachep, new_tb2);
2e20fc25bca52f Joanne Koong 2022-07-12  889
2e20fc25bca52f Joanne Koong 2022-07-12  890  	return 0;
2e20fc25bca52f Joanne Koong 2022-07-12  891  }
2e20fc25bca52f Joanne Koong 2022-07-12  892  EXPORT_SYMBOL_GPL(inet_bhash2_update_saddr);
2e20fc25bca52f Joanne Koong 2022-07-12  893

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ