From: Andrei Otcheretianski Date: Thu, 12 Mar 2015 06:53:30 +0000 (+0200) Subject: mac80211: count interfaces correctly for combination checks X-Git-Tag: v3.19.4~37 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=89e1dc988d602f16b5239928359f5a1c6fdbb008;p=thirdparty%2Fkernel%2Fstable.git mac80211: count interfaces correctly for combination checks commit 0f611d28fc2e13cfec64e1c544c16a086886805a upstream. Since moving the interface combination checks to mac80211, it's broken because it now only considers interfaces with an assigned channel context, so for example any interface that isn't active can still be up, which is clearly an issue; also, in particular P2P-Device wdevs are an issue since they never have a chanctx. Fix this by counting running interfaces instead the ones with a channel context assigned. Fixes: 73de86a38962b ("cfg80211/mac80211: move interface counting for combination check to mac80211") Signed-off-by: Andrei Otcheretianski Signed-off-by: Emmanuel Grumbach [rewrite commit message, dig out the commit it fixes] Signed-off-by: Johannes Berg Signed-off-by: Greg Kroah-Hartman --- diff --git a/net/mac80211/util.c b/net/mac80211/util.c index 974ebe70f5b01..1ce38e71ecd8c 100644 --- a/net/mac80211/util.c +++ b/net/mac80211/util.c @@ -3153,7 +3153,7 @@ int ieee80211_check_combinations(struct ieee80211_sub_if_data *sdata, wdev_iter = &sdata_iter->wdev; if (sdata_iter == sdata || - rcu_access_pointer(sdata_iter->vif.chanctx_conf) == NULL || + !ieee80211_sdata_running(sdata_iter) || local->hw.wiphy->software_iftypes & BIT(wdev_iter->iftype)) continue;