cfg80211: validate nl80211 station handling better
The nl80211 station handling code is a bit messy and doesn't do a lot of validation. It seems like this could be an issue for drivers that don't use mac80211 to validate everything. As cfg80211 doesn't keep station state, move the validation of allowing supported_rates to change for TDLS only in station mode to mac80211. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:

committed by
John W. Linville

parent
d83023daa2
commit
bdd90d5e36
@@ -976,6 +976,14 @@ static int ieee80211_change_station(struct wiphy *wiphy,
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* in station mode, supported rates are only valid with TDLS */
|
||||
if (sdata->vif.type == NL80211_IFTYPE_STATION &&
|
||||
params->supported_rates &&
|
||||
!test_sta_flag(sta, WLAN_STA_TDLS_PEER)) {
|
||||
rcu_read_unlock();
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (params->vlan && params->vlan != sta->sdata->dev) {
|
||||
vlansdata = IEEE80211_DEV_TO_SUB_IF(params->vlan);
|
||||
|
||||
|
Reference in New Issue
Block a user