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:	Wed, 25 Feb 2009 16:50:13 +0100
From:	Peter Zijlstra <peterz@...radead.org>
To:	Jan-Bernd Themann <ossthema@...ibm.com>
Cc:	"Sachin P. Sant" <sachinp@...ibm.com>, linuxppc-dev@...abs.org,
	netdev <netdev@...r.kernel.org>, TKLEIN@...ibm.com,
	Jan-Bernd Themann <THEMANN@...ibm.com>,
	Mel Gorman <mel@....ul.ie>,
	Kamalesh Babulal <kamalesh@...ux.vnet.ibm.com>,
	Ingo Molnar <mingo@...e.hu>
Subject: Re: [Powerpc / eHEA] Circular dependency with 2.6.29-rc6

On Wed, 2009-02-25 at 16:05 +0100, Jan-Bernd Themann wrote:

> - When "open" is called for a registered network device, port->port_lock
> is taken first,
>   then ehea_fw_handles.lock
> - When "open" is left these locks are released in a proper way (inverse
> order)

So this has:

  port->port_lock
    ehea_fw_handles.lock

This would be the case that is generating the warning.

> - In addition: ehea_fw_handles.lock is held by the function
> "driver_probe_device"
>   that registers all available network devices (register_netdev)
> - When multiple network devices are registered, it is possible that
> "open" is
>   called on an already registered network device while further
> netdevices are still registered
>   in "driver_probe_device". ---> "open" will take port->port_lock, but
> won't get ehea_fw_handles.lock

Right, so here you have 

  ehea_fw_handles.lock
    port->port_lock

Overlay these two cases and you have AB-BA deadlocks.

> - However, ehea_fw_handles.lock is freed once all netdevices are registered.
> - When the second netdevice is registered in "driver_probe_device", it
> will also try to get
>   the port->port_lock (which in fact is a different one, as there is one
> per netdevice).
> - Does the mutex debug mechanism distinguish between the different
> port->port_lock instances?

Not unless you tell it to.

Are you really sure the port->port_lock in this AB-BA scenario are never
the same? The above explanation didn't convince me (also very hard to
read due to funny wrapping).

Suppose you do an open concurrently with a re-probe, which apparently
takes port->port_lock's of existing devices, in the above scenario that
deadlocks.

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ