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: <20140415145017.GK1863@htj.dyndns.org>
Date:	Tue, 15 Apr 2014 10:50:17 -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 v3] Use kernfs_break_active_protection() for device
 online store callbacks

Hello,

On Tue, Apr 15, 2014 at 10:44:37AM +0800, Li Zhong wrote:
> / *
>   * This process might deadlock with another process trying to 
>   * remove this device:
>   * This process holding the s_active of "online" attribute, and tries 
>   * to online/offline the device with some locks protecting hotplug.
>   * Device removing process holding some locks protecting hotplug, and 
>   * tries to remove the "online" attribute, waiting for the s_active to
>   * be released. 
>   *
>   * The deadlock described above should be solved with
>   * lock_device_hotplug_sysfs(). We temporarily drop the active 
>   * protection here to avoid some lockdep warnings. 
>   *
>   * If device_hotplug_lock is forgotten to be used when removing
>   * device(possibly some very simple device even don't need this lock?),
>   * @dev could go away any time after dropping the active protection. 
>   * So increase its ref count before dropping active protection. 
>   * Though invoking device_{on|off}line() on a removed device seems
>   * unreasonable, it should be less disastrous than playing with freed
>   * @dev. Also, we might be able to have some mechanism abort 
>   * device_{on|off}line() if @dev already removed.
>   */

Hmmm... I'm not sure I fully understand the problem.  Does the code
ever try to remove "online" while holding cpu_add_remove_lock and,
when written 0, online knob grabs cpu_add_remove_lock?  If so, that is
an actually possible deadlock, no?

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