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] [day] [month] [year] [list]
Message-ID: <202209301749.4LyF5Oit-lkp@intel.com>
Date:   Fri, 30 Sep 2022 17:43:39 +0800
From:   kernel test robot <lkp@...el.com>
To:     Hangbin Liu <liuhangbin@...il.com>, netdev@...r.kernel.org
Cc:     kbuild-all@...ts.01.org, Eric Dumazet <edumazet@...gle.com>,
        Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>,
        Ido Schimmel <idosch@...dia.com>,
        Petr Machata <petrm@...dia.com>,
        Florent Fourcot <florent.fourcot@...irst.fr>,
        Nikolay Aleksandrov <razor@...ckwall.org>,
        Nicolas Dichtel <nicolas.dichtel@...nd.com>,
        Guillaume Nault <gnault@...hat.com>,
        David Ahern <dsahern@...nel.org>,
        Hangbin Liu <liuhangbin@...il.com>
Subject: Re: [PATCHv4 net-next 2/4] net: add new helper
 unregister_netdevice_many_notify

Hi Hangbin,

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/Hangbin-Liu/rtnetlink-Honour-NLM_F_ECHO-flag-in-rtnl_-new-del-link/20220930-150212
base:   https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git d742ea6b8e85f7b0d484bc23392d607b50667da6
config: arc-defconfig
compiler: arc-elf-gcc (GCC) 12.1.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/intel-lab-lkp/linux/commit/1d7d97a03bd49e062542c462acadf8ec99d32180
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Hangbin-Liu/rtnetlink-Honour-NLM_F_ECHO-flag-in-rtnl_-new-del-link/20220930-150212
        git checkout 1d7d97a03bd49e062542c462acadf8ec99d32180
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=arc SHELL=/bin/bash net/core/

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

All warnings (new ones prefixed by >>):

>> net/core/dev.c:10790: warning: expecting prototype for unregister_netdevice_many(). Prototype was for unregister_netdevice_many_notify() instead


vim +10790 net/core/dev.c

^1da177e4c3f41 Linus Torvalds 2005-04-16  10778  
9b5e383c11b087 Eric Dumazet   2009-10-27  10779  /**
9b5e383c11b087 Eric Dumazet   2009-10-27  10780   *	unregister_netdevice_many - unregister many devices
9b5e383c11b087 Eric Dumazet   2009-10-27  10781   *	@head: list of devices
1d7d97a03bd49e Hangbin Liu    2022-09-30  10782   *	@nlh: netlink message header
1d7d97a03bd49e Hangbin Liu    2022-09-30  10783   *	@pid: destination netlink portid for reports
87757a917b0b3c Eric Dumazet   2014-06-06  10784   *
87757a917b0b3c Eric Dumazet   2014-06-06  10785   *  Note: As most callers use a stack allocated list_head,
87757a917b0b3c Eric Dumazet   2014-06-06  10786   *  we force a list_del() to make sure stack wont be corrupted later.
9b5e383c11b087 Eric Dumazet   2009-10-27  10787   */
1d7d97a03bd49e Hangbin Liu    2022-09-30  10788  void unregister_netdevice_many_notify(struct list_head *head,
1d7d97a03bd49e Hangbin Liu    2022-09-30  10789  				      struct nlmsghdr *nlh, u32 pid)
bcfe2f1a3818d9 Jakub Kicinski 2021-01-19 @10790  {
bcfe2f1a3818d9 Jakub Kicinski 2021-01-19  10791  	struct net_device *dev, *tmp;
bcfe2f1a3818d9 Jakub Kicinski 2021-01-19  10792  	LIST_HEAD(close_head);
bcfe2f1a3818d9 Jakub Kicinski 2021-01-19  10793  
bcfe2f1a3818d9 Jakub Kicinski 2021-01-19  10794  	BUG_ON(dev_boot_phase);
bcfe2f1a3818d9 Jakub Kicinski 2021-01-19  10795  	ASSERT_RTNL();
bcfe2f1a3818d9 Jakub Kicinski 2021-01-19  10796  
0cbe1e57a7b935 Jakub Kicinski 2021-01-19  10797  	if (list_empty(head))
0cbe1e57a7b935 Jakub Kicinski 2021-01-19  10798  		return;
0cbe1e57a7b935 Jakub Kicinski 2021-01-19  10799  
bcfe2f1a3818d9 Jakub Kicinski 2021-01-19  10800  	list_for_each_entry_safe(dev, tmp, head, unreg_list) {
bcfe2f1a3818d9 Jakub Kicinski 2021-01-19  10801  		/* Some devices call without registering
bcfe2f1a3818d9 Jakub Kicinski 2021-01-19  10802  		 * for initialization unwind. Remove those
bcfe2f1a3818d9 Jakub Kicinski 2021-01-19  10803  		 * devices and proceed with the remaining.
bcfe2f1a3818d9 Jakub Kicinski 2021-01-19  10804  		 */
bcfe2f1a3818d9 Jakub Kicinski 2021-01-19  10805  		if (dev->reg_state == NETREG_UNINITIALIZED) {
bcfe2f1a3818d9 Jakub Kicinski 2021-01-19  10806  			pr_debug("unregister_netdevice: device %s/%p never was registered\n",
bcfe2f1a3818d9 Jakub Kicinski 2021-01-19  10807  				 dev->name, dev);
bcfe2f1a3818d9 Jakub Kicinski 2021-01-19  10808  
bcfe2f1a3818d9 Jakub Kicinski 2021-01-19  10809  			WARN_ON(1);
bcfe2f1a3818d9 Jakub Kicinski 2021-01-19  10810  			list_del(&dev->unreg_list);
bcfe2f1a3818d9 Jakub Kicinski 2021-01-19  10811  			continue;
bcfe2f1a3818d9 Jakub Kicinski 2021-01-19  10812  		}
bcfe2f1a3818d9 Jakub Kicinski 2021-01-19  10813  		dev->dismantle = true;
bcfe2f1a3818d9 Jakub Kicinski 2021-01-19  10814  		BUG_ON(dev->reg_state != NETREG_REGISTERED);
bcfe2f1a3818d9 Jakub Kicinski 2021-01-19  10815  	}
bcfe2f1a3818d9 Jakub Kicinski 2021-01-19  10816  
bcfe2f1a3818d9 Jakub Kicinski 2021-01-19  10817  	/* If device is running, close it first. */
bcfe2f1a3818d9 Jakub Kicinski 2021-01-19  10818  	list_for_each_entry(dev, head, unreg_list)
bcfe2f1a3818d9 Jakub Kicinski 2021-01-19  10819  		list_add_tail(&dev->close_list, &close_head);
bcfe2f1a3818d9 Jakub Kicinski 2021-01-19  10820  	dev_close_many(&close_head, true);
bcfe2f1a3818d9 Jakub Kicinski 2021-01-19  10821  
bcfe2f1a3818d9 Jakub Kicinski 2021-01-19  10822  	list_for_each_entry(dev, head, unreg_list) {
bcfe2f1a3818d9 Jakub Kicinski 2021-01-19  10823  		/* And unlink it from device chain. */
cc26c2661fefea Eric Dumazet   2022-06-16  10824  		write_lock(&dev_base_lock);
cc26c2661fefea Eric Dumazet   2022-06-16  10825  		unlist_netdevice(dev, false);
bcfe2f1a3818d9 Jakub Kicinski 2021-01-19  10826  		dev->reg_state = NETREG_UNREGISTERING;
cc26c2661fefea Eric Dumazet   2022-06-16  10827  		write_unlock(&dev_base_lock);
bcfe2f1a3818d9 Jakub Kicinski 2021-01-19  10828  	}
bcfe2f1a3818d9 Jakub Kicinski 2021-01-19  10829  	flush_all_backlogs();
bcfe2f1a3818d9 Jakub Kicinski 2021-01-19  10830  
bcfe2f1a3818d9 Jakub Kicinski 2021-01-19  10831  	synchronize_net();
bcfe2f1a3818d9 Jakub Kicinski 2021-01-19  10832  
bcfe2f1a3818d9 Jakub Kicinski 2021-01-19  10833  	list_for_each_entry(dev, head, unreg_list) {
bcfe2f1a3818d9 Jakub Kicinski 2021-01-19  10834  		struct sk_buff *skb = NULL;
bcfe2f1a3818d9 Jakub Kicinski 2021-01-19  10835  
bcfe2f1a3818d9 Jakub Kicinski 2021-01-19  10836  		/* Shutdown queueing discipline. */
bcfe2f1a3818d9 Jakub Kicinski 2021-01-19  10837  		dev_shutdown(dev);
bcfe2f1a3818d9 Jakub Kicinski 2021-01-19  10838  
bcfe2f1a3818d9 Jakub Kicinski 2021-01-19  10839  		dev_xdp_uninstall(dev);
bcfe2f1a3818d9 Jakub Kicinski 2021-01-19  10840  
9309f97aef6d82 Petr Machata   2022-03-02  10841  		netdev_offload_xstats_disable_all(dev);
9309f97aef6d82 Petr Machata   2022-03-02  10842  
bcfe2f1a3818d9 Jakub Kicinski 2021-01-19  10843  		/* Notify protocols, that we are about to destroy
bcfe2f1a3818d9 Jakub Kicinski 2021-01-19  10844  		 * this device. They should clean all the things.
bcfe2f1a3818d9 Jakub Kicinski 2021-01-19  10845  		 */
bcfe2f1a3818d9 Jakub Kicinski 2021-01-19  10846  		call_netdevice_notifiers(NETDEV_UNREGISTER, dev);
bcfe2f1a3818d9 Jakub Kicinski 2021-01-19  10847  
bcfe2f1a3818d9 Jakub Kicinski 2021-01-19  10848  		if (!dev->rtnl_link_ops ||
bcfe2f1a3818d9 Jakub Kicinski 2021-01-19  10849  		    dev->rtnl_link_state == RTNL_LINK_INITIALIZED)
bcfe2f1a3818d9 Jakub Kicinski 2021-01-19  10850  			skb = rtmsg_ifinfo_build_skb(RTM_DELLINK, dev, ~0U, 0,
1d7d97a03bd49e Hangbin Liu    2022-09-30  10851  						     GFP_KERNEL, NULL, 0,
1d7d97a03bd49e Hangbin Liu    2022-09-30  10852  						     pid, nlh ? nlh->nlmsg_seq : 0);
bcfe2f1a3818d9 Jakub Kicinski 2021-01-19  10853  
bcfe2f1a3818d9 Jakub Kicinski 2021-01-19  10854  		/*
bcfe2f1a3818d9 Jakub Kicinski 2021-01-19  10855  		 *	Flush the unicast and multicast chains
bcfe2f1a3818d9 Jakub Kicinski 2021-01-19  10856  		 */
bcfe2f1a3818d9 Jakub Kicinski 2021-01-19  10857  		dev_uc_flush(dev);
bcfe2f1a3818d9 Jakub Kicinski 2021-01-19  10858  		dev_mc_flush(dev);
bcfe2f1a3818d9 Jakub Kicinski 2021-01-19  10859  
bcfe2f1a3818d9 Jakub Kicinski 2021-01-19  10860  		netdev_name_node_alt_flush(dev);
bcfe2f1a3818d9 Jakub Kicinski 2021-01-19  10861  		netdev_name_node_free(dev->name_node);
bcfe2f1a3818d9 Jakub Kicinski 2021-01-19  10862  
bcfe2f1a3818d9 Jakub Kicinski 2021-01-19  10863  		if (dev->netdev_ops->ndo_uninit)
bcfe2f1a3818d9 Jakub Kicinski 2021-01-19  10864  			dev->netdev_ops->ndo_uninit(dev);
bcfe2f1a3818d9 Jakub Kicinski 2021-01-19  10865  
bcfe2f1a3818d9 Jakub Kicinski 2021-01-19  10866  		if (skb)
1d7d97a03bd49e Hangbin Liu    2022-09-30  10867  			rtmsg_ifinfo_send(skb, dev, GFP_KERNEL, pid, nlh);
bcfe2f1a3818d9 Jakub Kicinski 2021-01-19  10868  
bcfe2f1a3818d9 Jakub Kicinski 2021-01-19  10869  		/* Notifier chain MUST detach us all upper devices. */
bcfe2f1a3818d9 Jakub Kicinski 2021-01-19  10870  		WARN_ON(netdev_has_any_upper_dev(dev));
bcfe2f1a3818d9 Jakub Kicinski 2021-01-19  10871  		WARN_ON(netdev_has_any_lower_dev(dev));
bcfe2f1a3818d9 Jakub Kicinski 2021-01-19  10872  
bcfe2f1a3818d9 Jakub Kicinski 2021-01-19  10873  		/* Remove entries from kobject tree */
bcfe2f1a3818d9 Jakub Kicinski 2021-01-19  10874  		netdev_unregister_kobject(dev);
bcfe2f1a3818d9 Jakub Kicinski 2021-01-19  10875  #ifdef CONFIG_XPS
bcfe2f1a3818d9 Jakub Kicinski 2021-01-19  10876  		/* Remove XPS queueing entries */
bcfe2f1a3818d9 Jakub Kicinski 2021-01-19  10877  		netif_reset_xps_queues_gt(dev, 0);
bcfe2f1a3818d9 Jakub Kicinski 2021-01-19  10878  #endif
bcfe2f1a3818d9 Jakub Kicinski 2021-01-19  10879  	}
bcfe2f1a3818d9 Jakub Kicinski 2021-01-19  10880  
bcfe2f1a3818d9 Jakub Kicinski 2021-01-19  10881  	synchronize_net();
bcfe2f1a3818d9 Jakub Kicinski 2021-01-19  10882  
bcfe2f1a3818d9 Jakub Kicinski 2021-01-19  10883  	list_for_each_entry(dev, head, unreg_list) {
d62607c3fe4591 Jakub Kicinski 2022-06-07  10884  		netdev_put(dev, &dev->dev_registered_tracker);
bcfe2f1a3818d9 Jakub Kicinski 2021-01-19  10885  		net_set_todo(dev);
bcfe2f1a3818d9 Jakub Kicinski 2021-01-19  10886  	}
0cbe1e57a7b935 Jakub Kicinski 2021-01-19  10887  
0cbe1e57a7b935 Jakub Kicinski 2021-01-19  10888  	list_del(head);
bcfe2f1a3818d9 Jakub Kicinski 2021-01-19  10889  }
1d7d97a03bd49e Hangbin Liu    2022-09-30  10890  EXPORT_SYMBOL(unregister_netdevice_many_notify);
1d7d97a03bd49e Hangbin Liu    2022-09-30  10891  

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

View attachment "config" of type "text/plain" (38839 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ