diff options
author | Johannes Berg <johannes.berg@intel.com> | 2012-12-27 11:32:09 -0500 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2013-01-03 07:01:45 -0500 |
commit | ba23d2068d85f6616ea5f92320c04e87d4b9e141 (patch) | |
tree | 8ea8b7d8ab39ada84c967531875aef24892667d6 /net/wireless/nl80211.c | |
parent | 21add825f90a50407e0121833c8b7cd2c071c478 (diff) |
cfg80211: disallow more station changes
The following changes are invalid and should be
disallowed when a station already exists:
* supported rates changes, except for TDLS peers
* listen interval changes
* HT capability changes
Disallow them and also update a mac80211 comment
explaining how they would be racy.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/wireless/nl80211.c')
-rw-r--r-- | net/wireless/nl80211.c | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 087f68ba6d7a..9bd8340af999 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c | |||
@@ -3188,13 +3188,9 @@ static int nl80211_set_station(struct sk_buff *skb, struct genl_info *info) | |||
3188 | nla_len(info->attrs[NL80211_ATTR_STA_SUPPORTED_RATES]); | 3188 | nla_len(info->attrs[NL80211_ATTR_STA_SUPPORTED_RATES]); |
3189 | } | 3189 | } |
3190 | 3190 | ||
3191 | if (info->attrs[NL80211_ATTR_STA_LISTEN_INTERVAL]) | 3191 | if (info->attrs[NL80211_ATTR_STA_LISTEN_INTERVAL] || |
3192 | params.listen_interval = | 3192 | info->attrs[NL80211_ATTR_HT_CAPABILITY]) |
3193 | nla_get_u16(info->attrs[NL80211_ATTR_STA_LISTEN_INTERVAL]); | 3193 | return -EINVAL; |
3194 | |||
3195 | if (info->attrs[NL80211_ATTR_HT_CAPABILITY]) | ||
3196 | params.ht_capa = | ||
3197 | nla_data(info->attrs[NL80211_ATTR_HT_CAPABILITY]); | ||
3198 | 3194 | ||
3199 | if (!rdev->ops->change_station) | 3195 | if (!rdev->ops->change_station) |
3200 | return -EOPNOTSUPP; | 3196 | return -EOPNOTSUPP; |
@@ -3246,6 +3242,10 @@ static int nl80211_set_station(struct sk_buff *skb, struct genl_info *info) | |||
3246 | BIT(NL80211_STA_FLAG_ASSOCIATED))) | 3242 | BIT(NL80211_STA_FLAG_ASSOCIATED))) |
3247 | return -EINVAL; | 3243 | return -EINVAL; |
3248 | 3244 | ||
3245 | /* reject other things that can't change */ | ||
3246 | if (params.supported_rates) | ||
3247 | return -EINVAL; | ||
3248 | |||
3249 | /* must be last in here for error handling */ | 3249 | /* must be last in here for error handling */ |
3250 | params.vlan = get_vlan(info, rdev); | 3250 | params.vlan = get_vlan(info, rdev); |
3251 | if (IS_ERR(params.vlan)) | 3251 | if (IS_ERR(params.vlan)) |
@@ -3265,10 +3265,6 @@ static int nl80211_set_station(struct sk_buff *skb, struct genl_info *info) | |||
3265 | /* disallow things sta doesn't support */ | 3265 | /* disallow things sta doesn't support */ |
3266 | if (params.plink_action) | 3266 | if (params.plink_action) |
3267 | return -EINVAL; | 3267 | return -EINVAL; |
3268 | if (params.ht_capa) | ||
3269 | return -EINVAL; | ||
3270 | if (params.listen_interval >= 0) | ||
3271 | return -EINVAL; | ||
3272 | /* reject any changes other than AUTHORIZED */ | 3268 | /* reject any changes other than AUTHORIZED */ |
3273 | if (params.sta_flags_mask & ~BIT(NL80211_STA_FLAG_AUTHORIZED)) | 3269 | if (params.sta_flags_mask & ~BIT(NL80211_STA_FLAG_AUTHORIZED)) |
3274 | return -EINVAL; | 3270 | return -EINVAL; |
@@ -3277,9 +3273,7 @@ static int nl80211_set_station(struct sk_buff *skb, struct genl_info *info) | |||
3277 | /* disallow things mesh doesn't support */ | 3273 | /* disallow things mesh doesn't support */ |
3278 | if (params.vlan) | 3274 | if (params.vlan) |
3279 | return -EINVAL; | 3275 | return -EINVAL; |
3280 | if (params.ht_capa) | 3276 | if (params.supported_rates) |
3281 | return -EINVAL; | ||
3282 | if (params.listen_interval >= 0) | ||
3283 | return -EINVAL; | 3277 | return -EINVAL; |
3284 | /* | 3278 | /* |
3285 | * No special handling for TDLS here -- the userspace | 3279 | * No special handling for TDLS here -- the userspace |