Skip to content

Commit bd63bd7

Browse files
computersforpeacegregkh
authored andcommitted
mac80211: Allow HE operation to be longer than expected.
[ Upstream commit 0f7e90f ] We observed some Cisco APs sending the following HE Operation IE in associate response: ff 0a 24 f4 3f 00 01 fc ff 00 00 00 Its HE operation parameter is 0x003ff4, so the expected total length is 7 which does not match the actual length = 10. This causes association failing with "HE AP is missing HE Capability/operation." According to P802.11ax_D4 Table9-94, HE operation is extensible, and according to 802.11-2016 10.27.8, STA should discard the part beyond the maximum length and parse the truncated element. Allow HE operation element to be longer than expected to handle this case and future extensions. Fixes: e4d005b ("mac80211: refactor extended element parsing") Signed-off-by: Brian Norris <briannorris@chromium.org> Signed-off-by: Yen-lin Lai <yenlinlai@chromium.org> Link: https://lore.kernel.org/r/20210223051926.2653301-1-yenlinlai@chromium.org Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent f865127 commit bd63bd7

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

‎net/mac80211/mlme.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5023,7 +5023,7 @@ static int ieee80211_prep_channel(struct ieee80211_sub_if_data *sdata,
50235023
he_oper_ie = cfg80211_find_ext_ie(WLAN_EID_EXT_HE_OPERATION,
50245024
ies->data, ies->len);
50255025
if (he_oper_ie &&
5026-
he_oper_ie[1] == ieee80211_he_oper_size(&he_oper_ie[3]))
5026+
he_oper_ie[1] >= ieee80211_he_oper_size(&he_oper_ie[3]))
50275027
he_oper = (void *)(he_oper_ie + 3);
50285028
else
50295029
he_oper = NULL;

‎net/mac80211/util.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -967,7 +967,7 @@ static void ieee80211_parse_extension_element(u32 *crc,
967967
break;
968968
case WLAN_EID_EXT_HE_OPERATION:
969969
if (len >= sizeof(*elems->he_operation) &&
970-
len == ieee80211_he_oper_size(data) - 1) {
970+
len >= ieee80211_he_oper_size(data) - 1) {
971971
if (crc)
972972
*crc = crc32_be(*crc, (void *)elem,
973973
elem->datalen + 2);

0 commit comments

Comments
 (0)