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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140410133116.GB25308@htj.dyndns.org>
Date:	Thu, 10 Apr 2014 09:31:16 -0400
From:	Tejun Heo <tj@...nel.org>
To:	Li Zhong <zhong@...ux.vnet.ibm.com>
Cc:	LKML <linux-kernel@...r.kernel.org>, gregkh@...uxfoundation.org,
	rafael.j.wysocki@...el.com, toshi.kani@...com
Subject: Re: [RFC PATCH] Suppress a device hot remove related lockdep warning

Hello,

On Thu, Apr 10, 2014 at 05:18:34PM +0800, Li Zhong wrote:
> I noticed following lockdep warning when trying acpi hot-remove cpus:
> 
> [84154.204080] ======================================================
> [84154.204080] [ INFO: possible circular locking dependency detected ]
> [84154.204080] 3.14.0-next-20140408+ #24 Tainted: G        W    
> [84154.204080] -------------------------------------------------------
> [84154.204080] bash/777 is trying to acquire lock:
> [84154.204080]  (cpu_add_remove_lock){+.+.+.}, at: [<ffffffff810664a7>] cpu_maps_update_begin+0x17/0x20
> [84154.213203] 
> [84154.213203] but task is already holding lock:
> [84154.213203]  (s_active#79){++++.+}, at: [<ffffffff81256e14>] kernfs_fop_write+0xe4/0x190
> [84154.213203] 
> [84154.213203] which lock already depends on the new lock.
> [84154.213203] 
> [84154.213203] 
> [84154.213203] the existing dependency chain (in reverse order) is:
> [84154.213203] 
...
> [84154.213203]  Possible unsafe locking scenario:
> [84154.213203] 
> [84154.213203]        CPU0                    CPU1
> [84154.213203]        ----                    ----
> [84154.213203]   lock(s_active#79);
> [84154.213203]                                lock(cpu_hotplug.lock#2);
> [84154.213203]                                lock(s_active#79);
> [84154.213203]   lock(cpu_add_remove_lock);
> [84154.213203] 
> [84154.213203]  *** DEADLOCK ***
> .............
> 
> The deadlock itself seems already fixed in commit 5e33bc41. 
> 
> This patch uses DEVICE_ATTR_IGNORE_LOCKDEP for "online" attr to suppress
> this lockdep warning. But I'm a little afraid it might also hide
> (future) potential real dead lock scenarios? 

I suppose this is happening because offlining a cpu involves removing
some sysfs files?  If the file isn't trying to remove itself, it
should be okay but I think it could be better to use
kernfs_break_active_protection() from online callback so that the
operation is actually outside the dependency chain rather than just
suppressing lockdep.

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