Message ID | 1432039021-29666-2-git-send-email-michal.kazior@tieto.com (mailing list archive) |
---|---|
State | Changes Requested |
Delegated to: | Johannes Berg |
Headers | show |
On Tue, 2015-05-19 at 14:37 +0200, Michal Kazior wrote: > Without "cfg80211: ignore netif running state when > changing iftype" it was possible for mac80211 to > crash the system due to an unexpected (and > incorrect) flow. > > Even with cfg80211 being fixed it still makes > sense to add a sanity check just in case. Since the description of this makes no sense standalone, I'm not applying this, and I'd like to ask you to change it even if we apply both to make more sense on its own. johannes -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 3469bbdc891c..74cc789f9c8e 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -1395,6 +1395,12 @@ static int ieee80211_change_station(struct wiphy *wiphy, vlansdata = IEEE80211_DEV_TO_SUB_IF(params->vlan); if (params->vlan->ieee80211_ptr->use_4addr) { + if (vlansdata->vif.type != NL80211_IFTYPE_AP_VLAN) { + WARN_ON(1); + err = -EINVAL; + goto out_err; + } + if (vlansdata->u.vlan.sta) { err = -EBUSY; goto out_err;
Without "cfg80211: ignore netif running state when changing iftype" it was possible for mac80211 to crash the system due to an unexpected (and incorrect) flow. Even with cfg80211 being fixed it still makes sense to add a sanity check just in case. Signed-off-by: Michal Kazior <michal.kazior@tieto.com> --- net/mac80211/cfg.c | 6 ++++++ 1 file changed, 6 insertions(+)