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:   Thu, 23 Mar 2023 14:29:24 +0000
From:   "Russell King (Oracle)" <linux@...linux.org.uk>
To:     Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc:     Andrew Lunn <andrew@...n.ch>,
        Heiner Kallweit <hkallweit1@...il.com>,
        Daniel Scally <djrscally@...il.com>,
        "David S. Miller" <davem@...emloft.net>,
        Eric Dumazet <edumazet@...gle.com>,
        Florian Fainelli <f.fainelli@...il.com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Heikki Krogerus <heikki.krogerus@...ux.intel.com>,
        Jakub Kicinski <kuba@...nel.org>, linux-acpi@...r.kernel.org,
        netdev@...r.kernel.org, Paolo Abeni <pabeni@...hat.com>,
        "Rafael J. Wysocki" <rafael@...nel.org>,
        Sakari Ailus <sakari.ailus@...ux.intel.com>,
        Vladimir Oltean <olteanv@...il.com>
Subject: Re: [PATCH RFC net-next 1/7] software node: allow named software
 node to be created

On Thu, Mar 23, 2023 at 03:59:07PM +0200, Andy Shevchenko wrote:
> On Wed, Mar 22, 2023 at 11:59:55AM +0000, Russell King wrote:
> > From: Vladimir Oltean <vladimir.oltean@....com>
> > 
> > Allow a named software node to be created, which is needed for software
> > nodes for a fixed-link specification for DSA.
> 
> ...
> 
> > +fwnode_create_named_software_node(const struct property_entry *properties,
> > +				  const struct fwnode_handle *parent,
> > +				  const char *name)
> >  {
> >  	struct fwnode_handle *fwnode;
> >  	struct software_node *node;
> > @@ -930,6 +931,7 @@ fwnode_create_software_node(const struct property_entry *properties,
> >  		return ERR_CAST(node);
> >  
> >  	node->parent = p ? p->node : NULL;
> > +	node->name = name;
> 
> The same question stays as before: how can we be sure that the name is unique
> and we won't have a collision?

This got discussed at length last time around, starting here:

https://lore.kernel.org/all/YtHGwz4v7VWKhIXG@smile.fi.intel.com/

My conclusion is that your concern is invalid, because we're creating
this tree:

	node%d
	+- phy-mode property
	`- fixed-link node
	   +- speed property
	   `- full-duplex (optional) property

Given that node%d will be allocated against the swnode_root_ids IDA,
then how can there possibly be a naming collision.

You would be correct if the "fixed-link" node were to be created at
root level, or if we were intentionally creating two swnodes under
the same parent with the same name, but we aren't.

Plus, the code _already_ allows for e.g. multiple "node1" names - for
example, one in root and one as a child node, since the code uses
separate IDAs to allocate those.

Hence, I do not recognise the conern you are raising, and I believe
your concern is not valid.

Your concern would be valid if it was a general concern about
fwnode_create_named_software_node() being used to create the same
named node under the same parent, but that IMHO is a programming
bug, no different from trying to create two devices under the same
parent with the same name.

So, unless you can be more expansive about _precisely_ what your
concern is, then I don't think there exists any problem with this.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ