Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

wifi: mac80211: do not use old MBSSID elements

When userspace brings down and deletes a non-transmitted profile,
it is expected to send a new updated Beacon template for the
transmitted profile of that multiple BSSID (MBSSID) group which
does not include the removed profile in MBSSID element. This
update comes via NL80211_CMD_SET_BEACON.

Such updates work well as long as the group continues to have at
least one non-transmitted profile as NL80211_ATTR_MBSSID_ELEMS
is included in the new Beacon template.

But when the last non-trasmitted profile is removed, it still
gets included in Beacon templates sent to driver. This happens
because when no MBSSID elements are sent by the userspace,
ieee80211_assign_beacon() ends up using the element stored from
earlier Beacon template.

Do not copy old MBSSID elements, instead userspace should always
include these when applicable.

Fixes: 2b3171c6fe0a ("mac80211: MBSSID beacon handling in AP mode")
Signed-off-by: Aloka Dixit <aloka.dixit@oss.qualcomm.com>
Link: https://patch.msgid.link/20251215174656.2866319-2-aloka.dixit@oss.qualcomm.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>

authored by

Aloka Dixit and committed by
Johannes Berg
a519be2f 99067b58

-10
-10
net/mac80211/cfg.c
··· 1345 1345 1346 1346 size = sizeof(*new) + new_head_len + new_tail_len; 1347 1347 1348 - /* new or old multiple BSSID elements? */ 1349 1348 if (params->mbssid_ies) { 1350 1349 mbssid = params->mbssid_ies; 1351 1350 size += struct_size(new->mbssid_ies, elem, mbssid->cnt); 1352 1351 if (params->rnr_ies) { 1353 1352 rnr = params->rnr_ies; 1354 - size += struct_size(new->rnr_ies, elem, rnr->cnt); 1355 - } 1356 - size += ieee80211_get_mbssid_beacon_len(mbssid, rnr, 1357 - mbssid->cnt); 1358 - } else if (old && old->mbssid_ies) { 1359 - mbssid = old->mbssid_ies; 1360 - size += struct_size(new->mbssid_ies, elem, mbssid->cnt); 1361 - if (old && old->rnr_ies) { 1362 - rnr = old->rnr_ies; 1363 1353 size += struct_size(new->rnr_ies, elem, rnr->cnt); 1364 1354 } 1365 1355 size += ieee80211_get_mbssid_beacon_len(mbssid, rnr,