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: <a230dbf8-2390-4cbc-9aa6-ef3cd052dcc6@lunn.ch>
Date: Mon, 7 Oct 2024 00:48:24 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Ivan Safonov <insafonov@...il.com>
Cc: "David S. Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>,
	Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
	Jiri Pirko <jiri@...nulli.us>,
	Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
	Lorenzo Bianconi <lorenzo@...nel.org>, netdev@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] net: fix register_netdev description

On Mon, Oct 07, 2024 at 01:00:19AM +0300, Ivan Safonov wrote:
> 
> 
> On 10/7/24 00:16, Andrew Lunn wrote:
> > On Sun, Oct 06, 2024 at 08:57:20PM +0300, Ivan Safonov wrote:
> > > register_netdev() does not expands the device name.
> > 
> > Please could you explain what makes you think it will not expand the
> > device name.
> > 
> > 	Andrew
> 
> It is the register_netdev implementation:
> 
> > int register_netdev(struct net_device *dev)
> > {
> > 	int err;
> > 
> > 	if (rtnl_lock_killable())
> > 		return -EINTR;
> > 	err = register_netdevice(dev);
> > 	rtnl_unlock();
> > 	return err;
> > }
> 
> There is no device name expansion, rtnl lock and register_netdevice call
> only. The register_netdevice expands device name using dev_get_valid_name().

 *	Take a completed network device structure and add it to the kernel
 *	interfaces. A %NETDEV_REGISTER message is sent to the netdev notifier
 *	chain. 0 is returned on success. A negative errno code is returned
 *	on a failure to set up the device, or if the name is a duplicate.
 *
 *	This is a wrapper around register_netdevice that takes the rtnl semaphore
 *	and expands the device name if you passed a format string to
 *	alloc_netdev.

So you are taking this comment to mean the wrapper. Then yes, the
wrapper does not expand the device nice. So please move the text about
expanding the name earlier. It is an important part of registering a
netdev, so should be mentioned.

    Andrew

---
pw-bot: cr

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ