mac80211: Fix race between ieee80211_rx_bss_put and lookup routines.
authorPavel Emelyanov <xemul@openvz.org>
Wed, 23 Apr 2008 07:47:15 +0000 (11:47 +0400)
committerJohn W. Linville <linville@tuxdriver.com>
Thu, 24 Apr 2008 01:25:35 +0000 (21:25 -0400)
commit1ebebea8e844d01c80b93b8ee4d696ee7c0cbc27
tree9e246a1aa36afcd735940a07253124b138e0ed03
parentd1d8f44a4e3c730984283c0bf4b3458e3a88c15a
mac80211: Fix race between ieee80211_rx_bss_put and lookup routines.

The put routine first decrements the users counter and then
(if it is zero) locks the sta_bss_lock and removes one from
the list and the hash.

Thus, any of ieee80211_sta_config_auth, ieee80211_rx_bss_get
or ieee80211_rx_mesh_bss_get can race with it by finding a
bss that is about to get kfree-ed.

Using atomic_dec_and_lock in ieee80211_rx_bss_put takes care
of this race.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
net/mac80211/mlme.c