diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2009-05-24 16:42:30 +0200 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-06-03 20:05:10 +0200 |
commit | 51b50fbeb574f581c0b112e035541f42fa3e604a (patch) | |
tree | 2e2b75a4863b7d9d9b8bcdd3cf56be66414d83bb /net/wireless | |
parent | rt2x00: Remove last usage of beacon_int from ieee80211_config (diff) | |
download | linux-51b50fbeb574f581c0b112e035541f42fa3e604a.tar.xz linux-51b50fbeb574f581c0b112e035541f42fa3e604a.zip |
cfg80211: validate AID of stations being added
We have some validation code in mac80211 but said code will
force an invalid AID to 0 which isn't a valid AID either;
instead require a valid AID (1-2007) to be passed in from
userspace in cfg80211 already. Also move the code before
the race comment since it can only be executed during STA
addition and thus is not racy.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/wireless')
-rw-r--r-- | net/wireless/nl80211.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 4b4d3c8a1aed..19dc796bb0b8 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -1738,7 +1738,11 @@ static int nl80211_new_station(struct sk_buff *skb, struct genl_info *info) nla_len(info->attrs[NL80211_ATTR_STA_SUPPORTED_RATES]); params.listen_interval = nla_get_u16(info->attrs[NL80211_ATTR_STA_LISTEN_INTERVAL]); + params.aid = nla_get_u16(info->attrs[NL80211_ATTR_STA_AID]); + if (!params.aid || params.aid > IEEE80211_MAX_AID) + return -EINVAL; + if (info->attrs[NL80211_ATTR_HT_CAPABILITY]) params.ht_capa = nla_data(info->attrs[NL80211_ATTR_HT_CAPABILITY]); |