aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorMichael Buesch <mb@bu3sch.de>2010-01-24 07:13:32 -0500
committerJohn W. Linville <linville@tuxdriver.com>2010-01-25 16:36:28 -0500
commit96869a39399269a776a94812e9fff3d38b47d838 (patch)
tree3e799868a0d686922bf09f4115df0f558ca82a06 /drivers
parent658965107e2a45a1a4297cb494adc55797dd9ad1 (diff)
b43: Workaround circular locking in hw-tkip key update callback
The TKIP key update callback is called from the RX path, where the driver mutex is already locked. This results in a circular locking bug. Avoid this by removing the lock. Johannes noted that there is a separate bug: The callback still breaks on SDIO hardware, because SDIO hardware access needs to sleep, but we are not allowed to sleep in the callback due to mac80211's RCU locking. Signed-off-by: Michael Buesch <mb@bu3sch.de> Tested-by: Larry Finger <Larry.Finger@lwfinger.net> Reported-by: kecsa@kutfo.hit.bme.hu Cc: Johannes Berg <johannes@sipsolutions.net> Cc: stable <stable@kernel.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/b43/main.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index 6d7cf3c2f7bf..66220cde9c49 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -856,22 +856,19 @@ static void b43_op_update_tkip_key(struct ieee80211_hw *hw,
856 if (B43_WARN_ON(!modparam_hwtkip)) 856 if (B43_WARN_ON(!modparam_hwtkip))
857 return; 857 return;
858 858
859 mutex_lock(&wl->mutex); 859 /* This is only called from the RX path through mac80211, where
860 860 * our mutex is already locked. */
861 B43_WARN_ON(!mutex_is_locked(&wl->mutex));
861 dev = wl->current_dev; 862 dev = wl->current_dev;
862 if (!dev || b43_status(dev) < B43_STAT_INITIALIZED) 863 B43_WARN_ON(!dev || b43_status(dev) < B43_STAT_INITIALIZED);
863 goto out_unlock;
864 864
865 keymac_write(dev, index, NULL); /* First zero out mac to avoid race */ 865 keymac_write(dev, index, NULL); /* First zero out mac to avoid race */
866 866
867 rx_tkip_phase1_write(dev, index, iv32, phase1key); 867 rx_tkip_phase1_write(dev, index, iv32, phase1key);
868 /* only pairwise TKIP keys are supported right now */ 868 /* only pairwise TKIP keys are supported right now */
869 if (WARN_ON(!sta)) 869 if (WARN_ON(!sta))
870 goto out_unlock; 870 return;
871 keymac_write(dev, index, sta->addr); 871 keymac_write(dev, index, sta->addr);
872
873out_unlock:
874 mutex_unlock(&wl->mutex);
875} 872}
876 873
877static void do_key_write(struct b43_wldev *dev, 874static void do_key_write(struct b43_wldev *dev,