Commit 33dc03da authored by David S. Miller's avatar David S. Miller

Merge tag 'mac80211-for-davem-2019-08-21' of...

Merge tag 'mac80211-for-davem-2019-08-21' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211

Johannes Berg says:

====================
Just three fixes:
 * extended key ID key installation
 * regulatory processing
 * possible memory leak in an error path
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents a1c4cd67 0d31d4db
...@@ -1546,6 +1546,11 @@ static int ieee80211_add_station(struct wiphy *wiphy, struct net_device *dev, ...@@ -1546,6 +1546,11 @@ static int ieee80211_add_station(struct wiphy *wiphy, struct net_device *dev,
if (is_multicast_ether_addr(mac)) if (is_multicast_ether_addr(mac))
return -EINVAL; return -EINVAL;
if (params->sta_flags_set & BIT(NL80211_STA_FLAG_TDLS_PEER) &&
sdata->vif.type == NL80211_IFTYPE_STATION &&
!sdata->u.mgd.associated)
return -EINVAL;
sta = sta_info_alloc(sdata, mac, GFP_KERNEL); sta = sta_info_alloc(sdata, mac, GFP_KERNEL);
if (!sta) if (!sta)
return -ENOMEM; return -ENOMEM;
...@@ -1553,10 +1558,6 @@ static int ieee80211_add_station(struct wiphy *wiphy, struct net_device *dev, ...@@ -1553,10 +1558,6 @@ static int ieee80211_add_station(struct wiphy *wiphy, struct net_device *dev,
if (params->sta_flags_set & BIT(NL80211_STA_FLAG_TDLS_PEER)) if (params->sta_flags_set & BIT(NL80211_STA_FLAG_TDLS_PEER))
sta->sta.tdls = true; sta->sta.tdls = true;
if (sta->sta.tdls && sdata->vif.type == NL80211_IFTYPE_STATION &&
!sdata->u.mgd.associated)
return -EINVAL;
err = sta_apply_parameters(local, sta, params); err = sta_apply_parameters(local, sta, params);
if (err) { if (err) {
sta_info_free(local, sta); sta_info_free(local, sta);
......
...@@ -2788,7 +2788,7 @@ static void reg_process_pending_hints(void) ...@@ -2788,7 +2788,7 @@ static void reg_process_pending_hints(void)
/* When last_request->processed becomes true this will be rescheduled */ /* When last_request->processed becomes true this will be rescheduled */
if (lr && !lr->processed) { if (lr && !lr->processed) {
reg_process_hint(lr); pr_debug("Pending regulatory request, waiting for it to be processed...\n");
return; return;
} }
......
...@@ -233,25 +233,30 @@ int cfg80211_validate_key_settings(struct cfg80211_registered_device *rdev, ...@@ -233,25 +233,30 @@ int cfg80211_validate_key_settings(struct cfg80211_registered_device *rdev,
switch (params->cipher) { switch (params->cipher) {
case WLAN_CIPHER_SUITE_TKIP: case WLAN_CIPHER_SUITE_TKIP:
/* Extended Key ID can only be used with CCMP/GCMP ciphers */
if ((pairwise && key_idx) ||
params->mode != NL80211_KEY_RX_TX)
return -EINVAL;
break;
case WLAN_CIPHER_SUITE_CCMP: case WLAN_CIPHER_SUITE_CCMP:
case WLAN_CIPHER_SUITE_CCMP_256: case WLAN_CIPHER_SUITE_CCMP_256:
case WLAN_CIPHER_SUITE_GCMP: case WLAN_CIPHER_SUITE_GCMP:
case WLAN_CIPHER_SUITE_GCMP_256: case WLAN_CIPHER_SUITE_GCMP_256:
/* IEEE802.11-2016 allows only 0 and - when using Extended Key /* IEEE802.11-2016 allows only 0 and - when supporting
* ID - 1 as index for pairwise keys. * Extended Key ID - 1 as index for pairwise keys.
* @NL80211_KEY_NO_TX is only allowed for pairwise keys when * @NL80211_KEY_NO_TX is only allowed for pairwise keys when
* the driver supports Extended Key ID. * the driver supports Extended Key ID.
* @NL80211_KEY_SET_TX can't be set when installing and * @NL80211_KEY_SET_TX can't be set when installing and
* validating a key. * validating a key.
*/ */
if (params->mode == NL80211_KEY_NO_TX) { if ((params->mode == NL80211_KEY_NO_TX && !pairwise) ||
if (!wiphy_ext_feature_isset(&rdev->wiphy, params->mode == NL80211_KEY_SET_TX)
NL80211_EXT_FEATURE_EXT_KEY_ID)) return -EINVAL;
return -EINVAL; if (wiphy_ext_feature_isset(&rdev->wiphy,
else if (!pairwise || key_idx < 0 || key_idx > 1) NL80211_EXT_FEATURE_EXT_KEY_ID)) {
if (pairwise && (key_idx < 0 || key_idx > 1))
return -EINVAL; return -EINVAL;
} else if ((pairwise && key_idx) || } else if (pairwise && key_idx) {
params->mode == NL80211_KEY_SET_TX) {
return -EINVAL; return -EINVAL;
} }
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment