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]
Message-ID: <a44ae5cd0804211501s7c269239qfee76726e3627d6b@mail.gmail.com>
Date:	Mon, 21 Apr 2008 18:01:43 -0400
From:	"Miles Lane" <miles.lane@...il.com>
To:	"Frederik Deweerdt" <deweerdt@...e.fr>
Cc:	"Andrew Morton" <akpm@...ux-foundation.org>,
	LKML <linux-kernel@...r.kernel.org>, "Greg KH" <gregkh@...e.de>,
	"Kay Sievers" <kay.sievers@...y.org>
Subject: Re: 2.6.25-mm1 -- WARNING: at fs/sysfs/dir.c:427 sysfs_add_one+0x33/0x9a()

On Mon, Apr 21, 2008 at 5:01 PM, Frederik Deweerdt <deweerdt@...e.fr> wrote:
> On Mon, Apr 21, 2008 at 02:56:52PM -0400, Miles Lane wrote:
>  > Is anyone interesting in following up on this?
>  >
>  Doesn't this
>  http://linux.derkeiler.com/Mailing-Lists/Kernel/2008-04/msg06990.html
>  fixes it?

That patch seems to have some problems:
http://groups.google.com/group/linux.kernel/browse_thread/thread/a9cfeae4ce67ee8e/2118788c3c81b2f3?#2118788c3c81b2f3
Should I apply this instead or as well?

From: Kay Sievers <kay.siev...@...y.org>
Subject: sysfs: fix duplicated device number registration in /sys/dev/

If the parent device has the same dev_t, we skip the registration
for the device number at /sys/dev.

Cc: Dan Williams <dan.j.willi...@...el.com>
Cc: Greg KH <g...@...ah.com>
Cc: Andrew Morton <a...@...ux-foundation.org>
Signed-off-by: Kay Sievers <kay.siev...@...y.org>
---

 core.c |   17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/drivers/base/core.c b/drivers/base/core.c
index de925f8..afedadb 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -821,10 +821,13 @@ int device_add(struct device *dev)
                if (error)
                        goto ueventattrError;

-               format_dev_t(devt_str, dev->devt);
-               error = sysfs_create_link(kobj, &dev->kobj, devt_str);
-               if (error)
-                       goto devtattrError;
+               /* do not create /sys/dev/ entry if parent already did */
+               if (!(dev->parent && dev->parent->devt == dev->devt)) {
+                       format_dev_t(devt_str, dev->devt);
+                       error = sysfs_create_link(kobj, &dev->kobj, devt_str);
+                       if (error)
+                               goto devtattrError;
+               }
        }

        error = device_add_class_symlinks(dev);
@@ -950,8 +953,10 @@ void device_del(struct device *dev)
        if (parent)
                klist_del(&dev->knode_parent);
        if (MAJOR(dev->devt)) {
-               format_dev_t(devt_str, dev->devt);
-               sysfs_remove_link(device_to_dev_kobj(dev), devt_str);
+               if (!(parent && parent->devt == dev->devt)) {
+                       format_dev_t(devt_str, dev->devt);
+                       sysfs_remove_link(device_to_dev_kobj(dev), devt_str);
+               }
                device_remove_file(dev, &devt_attr);
        }
        if (dev->class) {

--

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ