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]
Date:   Fri, 29 Mar 2019 21:45:56 +0800
From:   kbuild test robot <lkp@...el.com>
To:     Si-Wei Liu <si-wei.liu@...cle.com>
Cc:     kbuild-all@...org, mst@...hat.com, sridhar.samudrala@...el.com,
        stephen@...workplumber.org, davem@...emloft.net, kubakici@...pl,
        alexander.duyck@...il.com, jiri@...nulli.us,
        netdev@...r.kernel.org, virtualization@...ts.linux-foundation.org,
        liran.alon@...cle.com, boris.ostrovsky@...cle.com,
        vijay.balakrishna@...cle.com, si-wei liu <si-wei.liu@...cle.com>
Subject: Re: [PATCH net v4] failover: allow name change on IFF_UP slave
 interfaces

Hi Si-Wei,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on net/master]

url:    https://github.com/0day-ci/linux/commits/Si-Wei-Liu/failover-allow-name-change-on-IFF_UP-slave-interfaces/20190329-195445
config: x86_64-lkp (attached as .config)
compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All errors (new ones prefixed by >>):

   net/core/dev.c: In function 'dev_change_name':
>> net/core/dev.c:1252:48: error: passing argument 2 of 'call_netdevice_notifiers_info' from incompatible pointer type [-Werror=incompatible-pointer-types]
      call_netdevice_notifiers_info(NETDEV_CHANGE, dev,
                                                   ^~~
   net/core/dev.c:164:12: note: expected 'struct netdev_notifier_info *' but argument is of type 'struct net_device *'
    static int call_netdevice_notifiers_info(unsigned long val,
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> net/core/dev.c:1252:3: error: too many arguments to function 'call_netdevice_notifiers_info'
      call_netdevice_notifiers_info(NETDEV_CHANGE, dev,
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   net/core/dev.c:164:12: note: declared here
    static int call_netdevice_notifiers_info(unsigned long val,
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   cc1: some warnings being treated as errors

vim +/call_netdevice_notifiers_info +1252 net/core/dev.c

  1166	
  1167	/**
  1168	 *	dev_change_name - change name of a device
  1169	 *	@dev: device
  1170	 *	@newname: name (or format string) must be at least IFNAMSIZ
  1171	 *
  1172	 *	Change name of a device, can pass format strings "eth%d".
  1173	 *	for wildcarding.
  1174	 */
  1175	int dev_change_name(struct net_device *dev, const char *newname)
  1176	{
  1177		unsigned char old_assign_type;
  1178		char oldname[IFNAMSIZ];
  1179		int err = 0;
  1180		int ret;
  1181		struct net *net;
  1182	
  1183		ASSERT_RTNL();
  1184		BUG_ON(!dev_net(dev));
  1185	
  1186		net = dev_net(dev);
  1187	
  1188		/* Allow failover slave to rename even when
  1189		 * it is up and running.
  1190		 *
  1191		 * Failover slaves are special, since userspace
  1192		 * might rename the slave after the interface
  1193		 * has been brought up and running due to
  1194		 * auto-enslavement.
  1195		 *
  1196		 * Failover users don't actually care about slave
  1197		 * name change, as they are only expected to operate
  1198		 * on master interface directly.
  1199		 */
  1200		if (dev->flags & IFF_UP &&
  1201		    likely(!(dev->priv_flags & IFF_FAILOVER_SLAVE)))
  1202			return -EBUSY;
  1203	
  1204		write_seqcount_begin(&devnet_rename_seq);
  1205	
  1206		if (strncmp(newname, dev->name, IFNAMSIZ) == 0) {
  1207			write_seqcount_end(&devnet_rename_seq);
  1208			return 0;
  1209		}
  1210	
  1211		memcpy(oldname, dev->name, IFNAMSIZ);
  1212	
  1213		err = dev_get_valid_name(net, dev, newname);
  1214		if (err < 0) {
  1215			write_seqcount_end(&devnet_rename_seq);
  1216			return err;
  1217		}
  1218	
  1219		if (oldname[0] && !strchr(oldname, '%'))
  1220			netdev_info(dev, "renamed from %s\n", oldname);
  1221	
  1222		old_assign_type = dev->name_assign_type;
  1223		dev->name_assign_type = NET_NAME_RENAMED;
  1224	
  1225	rollback:
  1226		ret = device_rename(&dev->dev, dev->name);
  1227		if (ret) {
  1228			memcpy(dev->name, oldname, IFNAMSIZ);
  1229			dev->name_assign_type = old_assign_type;
  1230			write_seqcount_end(&devnet_rename_seq);
  1231			return ret;
  1232		}
  1233	
  1234		write_seqcount_end(&devnet_rename_seq);
  1235	
  1236		netdev_adjacent_rename_links(dev, oldname);
  1237	
  1238		write_lock_bh(&dev_base_lock);
  1239		hlist_del_rcu(&dev->name_hlist);
  1240		write_unlock_bh(&dev_base_lock);
  1241	
  1242		synchronize_rcu();
  1243	
  1244		write_lock_bh(&dev_base_lock);
  1245		hlist_add_head_rcu(&dev->name_hlist, dev_name_hash(net, dev->name));
  1246		write_unlock_bh(&dev_base_lock);
  1247	
  1248		if (unlikely(dev->flags & IFF_UP)) {
  1249			struct netdev_notifier_change_info change_info;
  1250	
  1251			change_info.flags_changed = 0;
> 1252			call_netdevice_notifiers_info(NETDEV_CHANGE, dev,
  1253						      &change_info.info);
  1254		}
  1255	
  1256		ret = call_netdevice_notifiers(NETDEV_CHANGENAME, dev);
  1257		ret = notifier_to_errno(ret);
  1258	
  1259		if (ret) {
  1260			/* err >= 0 after dev_alloc_name() or stores the first errno */
  1261			if (err >= 0) {
  1262				err = ret;
  1263				write_seqcount_begin(&devnet_rename_seq);
  1264				memcpy(dev->name, oldname, IFNAMSIZ);
  1265				memcpy(oldname, newname, IFNAMSIZ);
  1266				dev->name_assign_type = old_assign_type;
  1267				old_assign_type = NET_NAME_RENAMED;
  1268				goto rollback;
  1269			} else {
  1270				pr_err("%s: name change rollback failed: %d\n",
  1271				       dev->name, ret);
  1272			}
  1273		}
  1274	
  1275		return err;
  1276	}
  1277	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Download attachment ".config.gz" of type "application/gzip" (26574 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ