Commit afebe192 authored by Benjamin Berg's avatar Benjamin Berg Committed by Johannes Berg
Browse files

wifi: cfg80211: only verify part of Extended MLD Capabilities



We verify that the Extended MLD Capabilities are matching between links.
However, some bits are reserved and in particular the Recommended Max
Links subfield may not necessarily match. So only verify the known
subfields that can reliably be expected to be the same. More information
can be found in Table 9-417o, in IEEE P802.11be/D7.0.

Signed-off-by: default avatarBenjamin Berg <benjamin.berg@intel.com>
Reviewed-by: default avatarJohannes Berg <johannes.berg@intel.com>
Signed-off-by: default avatarMiri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250609213231.a2fad48dd3e6.Iae1740cd2ac833bc4a64fd2af718e1485158fd42@changeid


Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent a1d9979c
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -9,7 +9,7 @@
 * Copyright (c) 2006, Michael Wu <flamingice@sourmilk.net>
 * Copyright (c) 2013 - 2014 Intel Mobile Communications GmbH
 * Copyright (c) 2016 - 2017 Intel Deutschland GmbH
 * Copyright (c) 2018 - 2024 Intel Corporation
 * Copyright (c) 2018 - 2025 Intel Corporation
 */

#ifndef LINUX_IEEE80211_H
@@ -5333,6 +5333,13 @@ static inline u16 ieee80211_mle_get_mld_capa_op(const u8 *data)
	return get_unaligned_le16(common);
}

/* Defined in Figure 9-1074t in P802.11be_D7.0 */
#define IEEE80211_EHT_ML_EXT_MLD_CAPA_OP_PARAM_UPDATE           0x0001
#define IEEE80211_EHT_ML_EXT_MLD_CAPA_OP_RECO_MAX_LINKS_MASK    0x001e
#define IEEE80211_EHT_ML_EXT_MLD_CAPA_NSTR_UPDATE               0x0020
#define IEEE80211_EHT_ML_EXT_MLD_CAPA_EMLSR_ENA_ON_ONE_LINK     0x0040
#define IEEE80211_EHT_ML_EXT_MLD_CAPA_BTM_MLD_RECO_MULTI_AP     0x0080

/**
 * ieee80211_mle_get_ext_mld_capa_op - returns the extended MLD capabilities
 *	and operations.
+19 −2
Original line number Diff line number Diff line
@@ -352,8 +352,25 @@ cfg80211_mlme_check_mlo_compat(const struct ieee80211_multi_link_elem *mle_a,
		return -EINVAL;
	}

	if (ieee80211_mle_get_ext_mld_capa_op((const u8 *)mle_a) !=
	    ieee80211_mle_get_ext_mld_capa_op((const u8 *)mle_b)) {
	/*
	 * Only verify the values in Extended MLD Capabilities that are
	 * not reserved when transmitted by an AP (and expected to remain the
	 * same over time).
	 * The Recommended Max Simultaneous Links subfield in particular is
	 * reserved when included in a unicast Probe Response frame and may
	 * also change when the AP adds/removes links. The BTM MLD
	 * Recommendation For Multiple APs Support subfield is reserved when
	 * transmitted by an AP. All other bits are currently reserved.
	 * See IEEE P802.11be/D7.0, Table 9-417o.
	 */
	if ((ieee80211_mle_get_ext_mld_capa_op((const u8 *)mle_a) &
	     (IEEE80211_EHT_ML_EXT_MLD_CAPA_OP_PARAM_UPDATE |
	      IEEE80211_EHT_ML_EXT_MLD_CAPA_NSTR_UPDATE |
	      IEEE80211_EHT_ML_EXT_MLD_CAPA_EMLSR_ENA_ON_ONE_LINK)) !=
	    (ieee80211_mle_get_ext_mld_capa_op((const u8 *)mle_b) &
	     (IEEE80211_EHT_ML_EXT_MLD_CAPA_OP_PARAM_UPDATE |
	      IEEE80211_EHT_ML_EXT_MLD_CAPA_NSTR_UPDATE |
	      IEEE80211_EHT_ML_EXT_MLD_CAPA_EMLSR_ENA_ON_ONE_LINK))) {
		NL_SET_ERR_MSG(extack,
			       "extended link MLD capabilities/ops mismatch");
		return -EINVAL;