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: <20140222205217.GC16272@mtj.dyndns.org>
Date:	Sat, 22 Feb 2014 15:52:17 -0500
From:	Tejun Heo <tj@...nel.org>
To:	Sasha Levin <sasha.levin@...cle.com>
Cc:	Greg KH <greg@...ah.com>, a.zummo@...ertech.it,
	rtc-linux@...glegroups.com, LKML <linux-kernel@...r.kernel.org>
Subject: Re: kernfs/rtc: circular dependency between kernfs and ops_lock

Hello,

On Sat, Feb 22, 2014 at 12:51:42PM -0500, Sasha Levin wrote:
> While fuzzing with trinity inside a KVM tools guest running the
> latest -next kernel I've stumbled on the following (now with pretty
> line numbers!) spew:

Heh, that's pretty awesome.

> [  218.132898] ======================================================
> [  218.133902] [ INFO: possible circular locking dependency detected ]
> [  218.134820] 3.14.0-rc3-next-20140221-sasha-00008-g0e660cf-dirty #116 Tainted: G        W
> [  218.135911] -------------------------------------------------------
> [  218.136842] trinity-c47/11528 is trying to acquire lock:
> [  218.137613]  (&rtc->ops_lock){+.+.+.}, at: [<drivers/rtc/interface.c:42>] rtc_read_time+0x2b/0x60
> [  218.138909]
> [  218.138909] but task is already holding lock:
> [  218.139802]  (s_active#20){++++.+}, at: [<fs/kernfs/file.c:99>] kernfs_seq_start+0x34/0xa0
> [  218.140087]
> [  218.140087] which lock already depends on the new lock.

The problem is rtc_device_unregister().  It grabs rtc->ops_lock and
then tries to remove the sysfs files.  Some of those sysfs file
implementations acquire rtc->ops_lock, so it of course can lead to
deadlocks.  One can't try to delete a sysfs file which acquires a lock
while holding the same lock.

Thanks.

-- 
tejun
--
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