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  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:	Wed, 02 Jun 2010 17:53:12 -0700
From:	ebiederm@...ssion.com (Eric W. Biederman)
To:	Johannes Berg <johannes@...solutions.net>
Cc:	Greg KH <greg@...ah.com>, netdev <netdev@...r.kernel.org>,
	Kay Sievers <kay.sievers@...y.org>
Subject: [RFC][PATCH] Fix another namespace issue with devices assigned to classes


In the last painful restructuring of sysfs we created started
creating class directories under normal devices so we could place
devices such as network devices directly under their the hardware
that implements them instead of in their class directories like
/sys/class/net/.  This creation of class directories avoids the
need to worry about namespace clonflicts if something is renamed.

A special exception was made for devices that were still placed
directly in their class directory.  Looking at how this interacts
with the wireless network devices it appears this special exception
is either completely unneeded or at least needs to be restricted to
a parent device with the same class as the child device.  Certainly
in the case of unrelated classes we very much have the possibility
of namespace classes and we should be creating the subdirectory.

Johannes this should fix your issue with mac80211_hwsim, where
the device symlink were not destroyed when the driver was removed.

Greg, Kay where does that parent->class check come into play?  Do
we need it at all?

> commit 864062457a2e444227bd368ca5f2a2b740de604f
> Author: Kay Sievers <kay.sievers@...y.org>
> Date:   Wed Mar 14 03:25:56 2007 +0100
> 
>     driver core: fix namespace issue with devices assigned to classes
>     
>       - uses a kset in "struct class" to keep track of all directories
>         belonging to this class
>       - merges with the /sys/devices/virtual logic.
>       - removes the namespace-dir if the last member of that class
>         leaves the directory.
>     
>     There may be locking or refcounting fixes left, I stopped when it seemed
>     to work with network and sound modules. :)
>     
>     From: Kay Sievers <kay.sievers@...y.org>
>     Signed-off-by: Greg Kroah-Hartman <gregkh@...e.de>

Signed-off-by: "Eric W. Biederman" <ebiederm@...ssion.com>

---

diff --git a/drivers/base/core.c b/drivers/base/core.c
index 9630fbd..3725f81 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -673,7 +673,7 @@ static struct kobject *get_device_parent(struct device *dev,
 		 */
 		if (parent == NULL)
 			parent_kobj = virtual_device_parent(dev);
-		else if (parent->class)
+		else if (parent->class == dev->class)
 			return &parent->kobj;
 		else
 			parent_kobj = &parent->kobj;
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists