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: <20100420131420.GA27126@suse.de>
Date:	Tue, 20 Apr 2010 06:14:20 -0700
From:	Greg KH <gregkh@...e.de>
To:	Lai Jiangshan <laijs@...fujitsu.com>
Cc:	"Eric W. Biederman" <ebiederm@...ssion.com>,
	WANG Cong <xiyou.wangcong@...il.com>,
	Tejun Heo <tj@...nel.org>,
	Peter Zijlstra <peterz@...radead.org>,
	Ingo Molnar <mingo@...e.hu>,
	LKML <linux-kernel@...r.kernel.org>
Subject: Re: [BUG] sysfs: don't use allocated key for lockdep

On Tue, Apr 20, 2010 at 11:50:07AM +0800, Lai Jiangshan wrote:
> Reported-by: Lai Jiangshan <laijs@...fujitsu.com>
> 
> The commit 6992f5334995af474c2b58d010d08bc597f0f2fe
> does wrong thing that use allocated key for lockdep_map.
> 
> Lockdep requires keys that are static:
> 
> lockdep_init_map() {
> ......
> 	/*
> 	 * Sanity check, the lock-class key must be persistent:
> 	 */
> 	if (!static_obj(key)) {
> 		printk("BUG: key %p not in .data!\n", key);
> 		DEBUG_LOCKS_WARN_ON(1);
> 		return;
> 	}
> 	lock->key = key;
> ......
> }
> 
> Could you please fix it.

All in-kernel attributes should now be fixed, so what exactly is the
remaining issue?

> ----------------
> One other comment (not relate to this bug, but relate to the commit):
> It is not a very good idea that use one lockdep class per sysfs attribute.
> 
> First: we don't have too much lockdep class resource.
> Second: lockdep validator is O(N*N) algorithm.
>         (N is the number of used lockdep class)
> 
> So it is recommended that use only one class for a group of locks.
> 
> For some nesting requirement, you can use
> lock_acquire(...,subclass,...nest_lock,...)
> 
> Or change the design.
> --------------------
> 
> BUG: key ffff880042c68220 not in .data!
> ------------[ cut here ]------------
> WARNING: at kernel/lockdep.c:2706 lockdep_init_map+0xe6/0x4fb()
> Hardware name: Lenovo WQ T168/T468 G6
> Modules linked in: mptsas(+) mptscsih mptbase scsi_transport_sas ext4 jbd2 crc16 uhci_hcd ohci_hcd ehci_hcd
> Pid: 1329, comm: modprobe Not tainted 2.6.34-rc3-22949-gbc8a97a-dirty #1

Please try 2.6.34-rc5 and let us know if this still shows up.

thanks,

greg k-h
--
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