]> git.baikalelectronics.ru Git - kernel.git/commitdiff
wifi: cfg80211: Prevent cfg80211_wext_siwencodeext() on MLD
authorVeerendranath Jakkam <quic_vjakkam@quicinc.com>
Sat, 30 Jul 2022 05:26:42 +0000 (10:56 +0530)
committerJohannes Berg <johannes.berg@intel.com>
Thu, 25 Aug 2022 08:41:03 +0000 (10:41 +0200)
Currently, MLO support is not added for WEXT code and WEXT handlers are
prevented on MLDs. Prevent WEXT handler cfg80211_wext_siwencodeext()
also on MLD which is missed in commit d624b47de5de ("wifi: cfg80211: do
some rework towards MLO link APIs")

Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
Link: https://lore.kernel.org/r/20220730052643.1959111-3-quic_vjakkam@quicinc.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/wireless/wext-compat.c

index a9767bfe73300701c041dd11b983de2d4918cf5b..129d3bb91dfb1c0a5032b376b95ef0b256041f47 100644 (file)
@@ -685,6 +685,13 @@ static int cfg80211_wext_siwencodeext(struct net_device *dev,
            !rdev->ops->set_default_key)
                return -EOPNOTSUPP;
 
+       wdev_lock(wdev);
+       if (wdev->valid_links) {
+               wdev_unlock(wdev);
+               return -EOPNOTSUPP;
+       }
+       wdev_unlock(wdev);
+
        switch (ext->alg) {
        case IW_ENCODE_ALG_NONE:
                remove = true;