aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless
diff options
context:
space:
mode:
Diffstat (limited to 'net/wireless')
-rw-r--r--net/wireless/nl80211.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index aa2b3f35cc48..723512b48f2e 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -3119,7 +3119,8 @@ unlock_rtnl:
3119} 3119}
3120 3120
3121static int nl80211_crypto_settings(struct genl_info *info, 3121static int nl80211_crypto_settings(struct genl_info *info,
3122 struct cfg80211_crypto_settings *settings) 3122 struct cfg80211_crypto_settings *settings,
3123 int cipher_limit)
3123{ 3124{
3124 settings->control_port = info->attrs[NL80211_ATTR_CONTROL_PORT]; 3125 settings->control_port = info->attrs[NL80211_ATTR_CONTROL_PORT];
3125 3126
@@ -3134,7 +3135,7 @@ static int nl80211_crypto_settings(struct genl_info *info,
3134 if (len % sizeof(u32)) 3135 if (len % sizeof(u32))
3135 return -EINVAL; 3136 return -EINVAL;
3136 3137
3137 if (settings->n_ciphers_pairwise > NL80211_MAX_NR_CIPHER_SUITES) 3138 if (settings->n_ciphers_pairwise > cipher_limit)
3138 return -EINVAL; 3139 return -EINVAL;
3139 3140
3140 memcpy(settings->ciphers_pairwise, data, len); 3141 memcpy(settings->ciphers_pairwise, data, len);
@@ -3247,7 +3248,7 @@ static int nl80211_associate(struct sk_buff *skb, struct genl_info *info)
3247 } 3248 }
3248 } 3249 }
3249 3250
3250 err = nl80211_crypto_settings(info, &crypto); 3251 err = nl80211_crypto_settings(info, &crypto, 1);
3251 if (!err) 3252 if (!err)
3252 err = cfg80211_mlme_assoc(rdev, dev, chan, bssid, ssid, 3253 err = cfg80211_mlme_assoc(rdev, dev, chan, bssid, ssid,
3253 ssid_len, ie, ie_len, use_mfp, 3254 ssid_len, ie, ie_len, use_mfp,
@@ -3652,7 +3653,8 @@ static int nl80211_connect(struct sk_buff *skb, struct genl_info *info)
3652 3653
3653 connect.privacy = info->attrs[NL80211_ATTR_PRIVACY]; 3654 connect.privacy = info->attrs[NL80211_ATTR_PRIVACY];
3654 3655
3655 err = nl80211_crypto_settings(info, &connect.crypto); 3656 err = nl80211_crypto_settings(info, &connect.crypto,
3657 NL80211_MAX_NR_CIPHER_SUITES);
3656 if (err) 3658 if (err)
3657 return err; 3659 return err;
3658 rtnl_lock(); 3660 rtnl_lock();