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:	Mon, 9 Jun 2008 17:09:29 +0200
From:	"Vegard Nossum" <vegard.nossum@...il.com>
To:	"Cornelia Huck" <cornelia.huck@...ibm.com>
Cc:	"Adrian Bunk" <bunk@...nel.org>,
	"Andrew Morton" <akpm@...ux-foundation.org>,
	"Ingo Molnar" <mingo@...e.hu>, linux-kernel@...r.kernel.org,
	"Jens Axboe" <jens.axboe@...cle.com>,
	"Greg Kroah-Hartman" <gregkh@...e.de>,
	"Linus Torvalds" <torvalds@...ux-foundation.org>,
	"Rafael J. Wysocki" <rjw@...k.pl>,
	"Kay Sievers" <kay.sievers@...y.org>, "Neil Brown" <neilb@...e.de>,
	"Mariusz Kozlowski" <m.kozlowski@...land.pl>,
	"Dave Young" <hidave.darkstar@...il.com>
Subject: Re: [bug, 2.6.26-rc4/rc5] sporadic bootup crashes in blk_lookup_devt()/prepare_namespace()

On 6/9/08, Cornelia Huck <cornelia.huck@...ibm.com> wrote:
> On Mon, 9 Jun 2008 16:28:09 +0200,
>
> "Vegard Nossum" <vegard.nossum@...il.com> wrote:
>  > Everywhere else where we traverse the struct class->devices list, they
>  > have down(&class->sem); first and up(&class->sem); afterwards.
>  >
>  > Commit fd04897bb20be29d60f7e426a053545aebeaa61a even has this hunk:
>  > @@ -177,8 +177,7 @@ struct class {
>  >         struct list_head        devices;
>  >         struct list_head        interfaces;
>  >         struct kset             class_dirs;
>  > -       struct semaphore        sem;    /* locks both the children and interface
>  > -
>  > +       struct semaphore        sem; /* locks children, devices, interfaces */
>  >         struct class_attribute          * class_attrs;
>  >         struct class_device_attribute   * class_dev_attrs;
>  >         struct device_attribute         * dev_attrs;
>  >
>  >
>  > So why doesn't block/genhd.c do this too? It seems to me that the
>  > mutex locking here is simply a remnant of old code that happened to
>  > not crash in most cases by chance.
>  >
>
>
> Does this crash happen with the conversion to the class iterator
>  functions (should be in linux-next) as well? They take the class
>  mutex...

Ah, you mean this:

commit bb7ee70edb8745021c17ab604f2f4c897004e1c5
Author: Greg Kroah-Hartman <gregkh@...e.de>
Date:   Thu May 22 17:21:08 2008 -0400

    block: make blk_lookup_devt use the class iterator function

    Use the proper class iterator function instead of mucking around in the
    internals of the class structures.

    Cc: Kay Sievers <kay.sievers@...y.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@...e.de>

So it should already be fixed, then. But I guess we'll have to wait
for Ingo to run another couple of thousand tests to know the answer
;-)

Thanks!

Hm. Bugs already fixed elsewhere seems to be a recurring theme... I'll
look harder for changes/fixes in other trees the next time :-(


Vegard

PS: But what about printk_all_partitions()? There are more than just
this instance of the device list traversal code that don't use the
class semaphore.

PPS: Was that patch ever posted to LKML? I couldn't seem to find it.

-- 
"The animistic metaphor of the bug that maliciously sneaked in while
the programmer was not looking is intellectually dishonest as it
disguises that the error is the programmer's own creation."
	-- E. W. Dijkstra, EWD1036
--
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