Skip to content

Commit 130067e

Browse files
committed
wifi: mac80211: fix vendor-specific inheritance
If there's any vendor-specific element in the subelements then the outer element parsing must not parse any vendor element at all. This isn't implemented correctly now due to parsing into the pointers and then overriding them, so explicitly skip vendor elements if any exist in the sub- elements (non-transmitted profile or per-STA profile). Fixes: 671042a ("mac80211: support non-inheritance element") Reviewed-by: Ilan Peer <[email protected]> Reviewed-by: Miriam Rachel Korenblit <[email protected]> Link: https://patch.msgid.link/20250221112451.fd71e5268840.I9db3e6a3367e6ff38d052d07dc07005f0dd3bd5c@changeid Signed-off-by: Johannes Berg <[email protected]>
1 parent 99ca2c2 commit 130067e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

net/mac80211/parse.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ struct ieee80211_elems_parse {
4848
const struct element *ml_epcs_elem;
4949

5050
bool multi_link_inner;
51+
bool skip_vendor;
5152

5253
/*
5354
* scratch buffer that can be used for various element parsing related
@@ -400,6 +401,9 @@ _ieee802_11_parse_elems_full(struct ieee80211_elems_parse_params *params,
400401
IEEE80211_PARSE_ERR_BAD_ELEM_SIZE;
401402
break;
402403
case WLAN_EID_VENDOR_SPECIFIC:
404+
if (elems_parse->skip_vendor)
405+
break;
406+
403407
if (elen >= 4 && pos[0] == 0x00 && pos[1] == 0x50 &&
404408
pos[2] == 0xf2) {
405409
/* Microsoft OUI (00:50:F2) */
@@ -1054,12 +1058,16 @@ ieee802_11_parse_elems_full(struct ieee80211_elems_parse_params *params)
10541058
multi_link_inner = true;
10551059
}
10561060

1061+
elems_parse->skip_vendor =
1062+
cfg80211_find_elem(WLAN_EID_VENDOR_SPECIFIC,
1063+
sub.start, sub.len);
10571064
elems->crc = _ieee802_11_parse_elems_full(params, elems_parse,
10581065
non_inherit);
10591066

10601067
/* Override with nontransmitted/per-STA profile if found */
10611068
if (sub.len) {
10621069
elems_parse->multi_link_inner = multi_link_inner;
1070+
elems_parse->skip_vendor = false;
10631071
_ieee802_11_parse_elems_full(&sub, elems_parse, NULL);
10641072
}
10651073

0 commit comments

Comments
 (0)