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

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
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -1546,6 +1546,11 @@ static int ieee80211_add_station(struct wiphy *wiphy, struct net_device *dev,
	if (is_multicast_ether_addr(mac))
		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);
	if (!sta)
		return -ENOMEM;
@@ -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))
		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);
	if (err) {
		sta_info_free(local, sta);
+1 −1
Original line number Diff line number Diff line
@@ -2788,7 +2788,7 @@ static void reg_process_pending_hints(void)

	/* When last_request->processed becomes true this will be rescheduled */
	if (lr && !lr->processed) {
		reg_process_hint(lr);
		pr_debug("Pending regulatory request, waiting for it to be processed...\n");
		return;
	}

+14 −9
Original line number Diff line number Diff line
@@ -233,25 +233,30 @@ int cfg80211_validate_key_settings(struct cfg80211_registered_device *rdev,

	switch (params->cipher) {
	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_256:
	case WLAN_CIPHER_SUITE_GCMP:
	case WLAN_CIPHER_SUITE_GCMP_256:
		/* IEEE802.11-2016 allows only 0 and - when using Extended Key
		 * ID - 1 as index for pairwise keys.
		/* IEEE802.11-2016 allows only 0 and - when supporting
		 * Extended Key ID - 1 as index for pairwise keys.
		 * @NL80211_KEY_NO_TX is only allowed for pairwise keys when
		 * the driver supports Extended Key ID.
		 * @NL80211_KEY_SET_TX can't be set when installing and
		 * validating a key.
		 */
		if (params->mode == NL80211_KEY_NO_TX) {
			if (!wiphy_ext_feature_isset(&rdev->wiphy,
						     NL80211_EXT_FEATURE_EXT_KEY_ID))
		if ((params->mode == NL80211_KEY_NO_TX && !pairwise) ||
		    params->mode == NL80211_KEY_SET_TX)
			return -EINVAL;
			else if (!pairwise || key_idx < 0 || key_idx > 1)
		if (wiphy_ext_feature_isset(&rdev->wiphy,
					    NL80211_EXT_FEATURE_EXT_KEY_ID)) {
			if (pairwise && (key_idx < 0 || key_idx > 1))
				return -EINVAL;
		} else if ((pairwise && key_idx) ||
			   params->mode == NL80211_KEY_SET_TX) {
		} else if (pairwise && key_idx) {
			return -EINVAL;
		}
		break;