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, 19 May 2009 18:27:50 +0200
From:	Johannes Berg <johannes@...solutions.net>
To:	Oleg Nesterov <oleg@...hat.com>
Cc:	Ingo Molnar <mingo@...e.hu>,
	Zdenek Kabelac <zdenek.kabelac@...il.com>,
	"Rafael J. Wysocki" <rjw@...k.pl>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: INFO: possible circular locking dependency at
 cleanup_workqueue_thread

On Tue, 2009-05-19 at 18:09 +0200, Oleg Nesterov wrote:

> > Right. But exactly this happens in the hibernate case --
> 
> not sure I understand your "exactly this" ;)
> 
> But your explanation of the deadlock below looks great!

Yeah... I got side-tracked, I had a scenario in mind that actually
needed cpu_add_remove_lock().

> except I don't understand how cpu_add_remove_lock makes the difference...
> And thus I can't understand why cpu_down() (called lockless) have the
> same problems. Please see below.
> 
> > Anyway, you can have a deadlock like this:
> >
> > CPU 3			CPU 2				CPU 1
> > 							suspend/hibernate
> > 			something:
> > 			rtnl_lock()			device_pm_lock()
> > 							-> mutex_lock(&dpm_list_mtx)
> >
> > 			mutex_lock(&dpm_list_mtx)
> >
> > linkwatch_work
> >  -> rtnl_lock()
> > 							disable_nonboot_cpus()
> 
> let's suppose disable_nonboot_cpus() does not take cpu_add_remove_lock,
> 
> > 							-> flush CPU 3 workqueue
> 
> in this case the deadlock is still here?
> 
> We can't flush because we hold the lock (dpm_list_mtx) which depends
> on another lock taken by work->func(), the "classical" bug with flush.
> 
> No?

Yeah, it looks like cpu_add_remove_lock doesn't make a difference...
It's just lockdep reporting a longer chain that also leads to a
deadlock. OTOH just replace dpm_list_mtx with cpu_add_remove_lock and
you have the same scenario... happens too, I guess, somehow.

johannes

Download attachment "signature.asc" of type "application/pgp-signature" (802 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ