wifi: nl80211: check MLO support in authenticate
authorJohannes Berg <johannes.berg@intel.com>
Thu, 7 Jul 2022 16:19:27 +0000 (18:19 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 15 Jul 2022 09:43:19 +0000 (11:43 +0200)
We should check that MLO connections are supported before
attempting to authenticate with MLO parameters, check that.

Fixes: d648c23024bd ("wifi: nl80211: support MLO in auth/assoc")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/wireless/nl80211.c

index b75398f0d5b46e16e2063b14f045d138d73e306d..ee3826e8e52b3dcf6d54f1142ace9e564c99058e 100644 (file)
@@ -10410,6 +10410,8 @@ static int nl80211_authenticate(struct sk_buff *skb, struct genl_info *info)
        req.key_idx = key.idx;
        req.link_id = nl80211_link_id_or_invalid(info->attrs);
        if (req.link_id >= 0) {
+               if (!(rdev->wiphy.flags & WIPHY_FLAG_SUPPORTS_MLO))
+                       return -EINVAL;
                if (!info->attrs[NL80211_ATTR_MLD_ADDR])
                        return -EINVAL;
                req.ap_mld_addr = nla_data(info->attrs[NL80211_ATTR_MLD_ADDR]);