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, 5 Oct 2010 14:48:34 +1030
From:	Rusty Russell <rusty@...tcorp.com.au>
To:	Thomas Gleixner <tglx@...utronix.de>
Cc:	LKML <linux-kernel@...r.kernel.org>, Arnd Bergmann <arnd@...db.de>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	Jeremy Fitzhardinge <jeremy@...p.org>,
	Adrian Bunk <bunk@...sta.de>
Subject: Re: [BUG 2.6.36-rc6] list corruption in module_bug_finalize

On Mon, 4 Oct 2010 06:21:08 am Thomas Gleixner wrote:
> Current mainline triggers a list corruption bug in
> module_bug_finalize(). dmesg excerpt below.
> 
> The corresponding code says:
> 
>         /*
>          * Strictly speaking this should have a spinlock to protect against
>          * traversals, but since we only traverse on BUG()s, a spinlock
>          * could potentially lead to deadlock and thus be counter-productive.
>          */
>         list_add(&mod->bug_list, &module_bug_list);
> 
> I can see the traversal problem vs. BUG(), but what's protecting the
> list_add() ? BKL probably did, but is that true anymore ?

I've never even *seen* this code before :(

Looks like it went through Adrian Bunk to Andrew, but despite the fact that
it (foolishly) doesn't touch kernel/module.c, it's generic code and I should
have seen it.  It did change the linux/module.h header.

So, it used to be protected by module_mutex, but Linus and I cleaned that up.

So, we need a lock around this list for adding and removal.  I'd use
list_add_rcu to try to help the lockless traversal too...

And moving it from all the archs into kernel/module.c would be a nice bonus.

Nice catch!
Rusty.
--
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