aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2013-02-22 19:14:20 -0500
committerJohannes Berg <johannes.berg@intel.com>2013-03-06 10:36:00 -0500
commit7b4396bd6868f3d665c5f4cb53a9bdde5a2f4bf2 (patch)
tree432237208275a9a36b5a0caede4e0996cdb1c48e /net
parent8d1f7ecd2af55c0c82ffd2bff0ef0b26f16ea69f (diff)
mac80211: flush keys when stopping AP
Since hostapd will remove keys this isn't usually an issue, but we shouldn't leak keys to the next BSS started on the same interface. For VLANs this also fixes a bug, keys that aren't removed would otherwise be leaked. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net')
-rw-r--r--net/mac80211/cfg.c5
-rw-r--r--net/mac80211/iface.c2
2 files changed, 5 insertions, 2 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 8baa561c8f5b..9d708f9e246e 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -1035,9 +1035,12 @@ static int ieee80211_stop_ap(struct wiphy *wiphy, struct net_device *dev)
1035 sta_info_flush_defer(vlan); 1035 sta_info_flush_defer(vlan);
1036 sta_info_flush_defer(sdata); 1036 sta_info_flush_defer(sdata);
1037 rcu_barrier(); 1037 rcu_barrier();
1038 list_for_each_entry(vlan, &sdata->u.ap.vlans, u.vlan.list) 1038 list_for_each_entry(vlan, &sdata->u.ap.vlans, u.vlan.list) {
1039 sta_info_flush_cleanup(vlan); 1039 sta_info_flush_cleanup(vlan);
1040 ieee80211_free_keys(vlan);
1041 }
1040 sta_info_flush_cleanup(sdata); 1042 sta_info_flush_cleanup(sdata);
1043 ieee80211_free_keys(sdata);
1041 1044
1042 sdata->vif.bss_conf.enable_beacon = false; 1045 sdata->vif.bss_conf.enable_beacon = false;
1043 clear_bit(SDATA_STATE_OFFCHANNEL_BEACON_STOPPED, &sdata->state); 1046 clear_bit(SDATA_STATE_OFFCHANNEL_BEACON_STOPPED, &sdata->state);
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
index 8e0bf34f3f68..290de4d99697 100644
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -840,7 +840,7 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata,
840 840
841 /* 841 /*
842 * Free all remaining keys, there shouldn't be any, 842 * Free all remaining keys, there shouldn't be any,
843 * except maybe group keys in AP more or WDS? 843 * except maybe in WDS mode?
844 */ 844 */
845 ieee80211_free_keys(sdata); 845 ieee80211_free_keys(sdata);
846 846