linux-stable/net/wireless
Johannes Berg bc43b28c10 cfg80211: fix circular lock dependency (1)
Luis reported this lockdep complaint, that he had also
reported earlier but when trying to analyse I had been
locking at the wrong code, and never saw the problem:

(slightly abridged)
=======================================================
[ INFO: possible circular locking dependency detected ]
2.6.31-rc4-wl #6
-------------------------------------------------------
wpa_supplicant/3799 is trying to acquire lock:
 (cfg80211_mutex){+.+.+.}, at: [<ffffffffa009246a>] cfg80211_get_dev_from_ifindex+0x1a/0x90 [cfg80211]

but task is already holding lock:
 (rtnl_mutex){+.+.+.}, at: [<ffffffff81400ff2>] rtnl_lock+0x12/0x20

which lock already depends on the new lock.

the existing dependency chain (in reverse order) is:

-> #1 (rtnl_mutex){+.+.+.}:
       [<ffffffff810857b6>] __lock_acquire+0xd76/0x12b0
       [<ffffffff81085dd3>] lock_acquire+0xe3/0x120
       [<ffffffff814ee7a4>] mutex_lock_nested+0x44/0x350
       [<ffffffff81400ff2>] rtnl_lock+0x12/0x20
       [<ffffffffa009f6a5>] nl80211_send_reg_change_event+0x1f5/0x2a0 [cfg80211]
       [<ffffffffa009529e>] set_regdom+0x28e/0x4c0 [cfg80211]

-> #0 (cfg80211_mutex){+.+.+.}:
       [<ffffffff8108587b>] __lock_acquire+0xe3b/0x12b0
       [<ffffffff81085dd3>] lock_acquire+0xe3/0x120
       [<ffffffff814ee7a4>] mutex_lock_nested+0x44/0x350
       [<ffffffffa009246a>] cfg80211_get_dev_from_ifindex+0x1a/0x90 [cfg80211]
       [<ffffffffa009813f>] get_rdev_dev_by_info_ifindex+0x6f/0xa0 [cfg80211]
       [<ffffffffa009b12b>] nl80211_set_interface+0x3b/0x260 [cfg80211]

When looking at the correct code, the problem is quite
obvious. I'm not entirely sure which code paths lead
here, so until I can analyse it better let's just use
RCU to avoid the problem.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-29 15:45:56 -04:00
..
core.c cfg80211: make aware of net namespaces 2009-07-27 15:24:07 -04:00
core.h cfg80211: make aware of net namespaces 2009-07-27 15:24:07 -04:00
debugfs.c cfg80211: clean up naming once and for all 2009-07-10 15:02:33 -04:00
debugfs.h cfg80211: clean up naming once and for all 2009-07-10 15:02:33 -04:00
ibss.c cfg80211: fix NULL dereference in IBSS SIOCGIWAP 2009-07-24 15:05:09 -04:00
Kconfig cfg80211: implement iwpower 2009-07-10 15:01:51 -04:00
lib80211.c lib80211: consolidate crypt init routines 2008-11-21 11:08:17 -05:00
lib80211_crypt_ccmp.c lib80211: silence excessive crypto debugging messages 2009-03-16 18:01:58 -04:00
lib80211_crypt_tkip.c lib80211: silence excessive crypto debugging messages 2009-03-16 18:01:58 -04:00
lib80211_crypt_wep.c lib80211: absorb crypto bits from net/ieee80211 2008-11-21 11:08:17 -05:00
Makefile cfg80211: managed mode wext compatibility 2009-07-10 15:01:51 -04:00
mlme.c cfg80211: fix more bugs in mlme handling 2009-07-24 15:05:12 -04:00
nl80211.c cfg80211: fix circular lock dependency (1) 2009-07-29 15:45:56 -04:00
nl80211.h cfg80211: fix locking 2009-07-10 15:02:32 -04:00
radiotap.c wireless: use get/put_unaligned_* helpers 2008-05-14 16:29:32 -04:00
reg.c cfg80211: treat ieee80211_regdom hints as user hints 2009-07-24 15:05:19 -04:00
reg.h cfg80211: make __regulatory_hint() static 2009-02-27 14:52:59 -05:00
scan.c cfg80211: increase scan result expire time 2009-07-27 15:24:17 -04:00
sme.c cfg80211: make aware of net namespaces 2009-07-27 15:24:07 -04:00
sysfs.c cfg80211: rename cfg80211_registered_device's idx to wiphy_idx 2009-02-27 14:52:54 -05:00
sysfs.h [WIRELESS] cfg80211: New wireless config infrastructure. 2007-04-25 22:29:41 -07:00
util.c cfg80211: avoid setting default_key if add_key fails 2009-07-24 15:05:29 -04:00
wext-compat.c cfg80211: set_default_key only for WEP 2009-07-24 15:05:27 -04:00
wext-sme.c cfg80211: don't optimise wext calls too much 2009-07-24 15:05:21 -04:00
wext.c net/compat/wext: send different messages to compat tasks 2009-07-15 08:53:39 -07:00