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:	Tue, 31 Oct 2006 09:03:08 +0100
From:	Cornelia Huck <cornelia.huck@...ibm.com>
To:	linux-kernel@...r.kernel.org
Cc:	Andy Whitcroft <apw@...dowen.org>,
	Martin Bligh <mbligh@...gle.com>,
	Andrew Morton <akpm@...l.org>, Steve Fox <drfickle@...ibm.com>
Subject: Re: 2.6.19-rc3-mm1 -- missing network adaptors

On Mon, 30 Oct 2006 21:14:32 +0100,
Cornelia Huck <cornelia.huck@...ibm.com> wrote:

> With CONFIG_SYSFS_DEPRECATED set, you'll get errors for devices which
> have no parent set. The kobject's parent is set to the class
> subsystem's kobject, meaning there is a child with name bus_id (e.
> g. /sys/class/net/lo). Unfortunately, we also try to create a link
> named bus_id in /sys/class/<foo>, which will fail with -EEXIST... We
> should probably drop that link if we have no parent.

You can use the following as a band-aid (everything looks sane on my
system), although you will still have problems if your setup tools
can't cope with symlinks :/ (a link is still created for devices with
real parents).

Signed-off-by: Cornelia Huck <cornelia.huck@...ibm.com>

---
 drivers/base/core.c |   19 ++++++++++++++-----
 1 files changed, 14 insertions(+), 5 deletions(-)

--- linux-2.6-CH.orig/drivers/base/core.c
+++ linux-2.6-CH/drivers/base/core.c
@@ -368,6 +368,12 @@ static void klist_children_put(struct kl
 static int device_add_class_symlinks(struct device *dev)
 {
 	int error;
+	int create_link =
+#ifdef CONFIG_SYSFS_DEPRECATED
+		dev->parent ? 1 : 0;
+#else
+	1;
+#endif
 
 	if (!dev->class)
 		return 0;
@@ -375,10 +381,12 @@ static int device_add_class_symlinks(str
 				  "subsystem");
 	if (error)
 		goto out;
-	error = sysfs_create_link(&dev->class->subsys.kset.kobj, &dev->kobj,
-				  dev->bus_id);
-	if (error)
-		goto out_subsys;
+	if (create_link) {
+		error = sysfs_create_link(&dev->class->subsys.kset.kobj,
+					  &dev->kobj, dev->bus_id);
+		if (error)
+			goto out_subsys;
+	}
 #ifdef CONFIG_SYSFS_DEPRECATED
 	if (dev->parent) {
 		char *class_name;
@@ -407,7 +415,8 @@ out_device:
 		sysfs_remove_link(&dev->kobj, "device");
 out_busid:
 #endif
-	sysfs_remove_link(&dev->class->subsys.kset.kobj, dev->bus_id);
+	if (create_link)
+		sysfs_remove_link(&dev->class->subsys.kset.kobj, dev->bus_id);
 out_subsys:
 	sysfs_remove_link(&dev->kobj, "subsystem");
 out:
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ