Skip to content

Commit

Permalink
wifi: cfg80211: don't allow multi-BSSID in S1G
Browse files Browse the repository at this point in the history
In S1G beacon frames there shouldn't be multi-BSSID elements
since that's not supported, remove that to avoid a potential
integer underflow and/or misparsing the frames due to the
different length of the fixed part of the frame.

While at it, initialize non_tx_data so we don't send garbage
values to the user (even if it doesn't seem to matter now.)

Reported-and-tested-by: Sönke Huster <[email protected]>
Fixes: 9eaffe5 ("cfg80211: convert S1G beacon to scan results")
Signed-off-by: Johannes Berg <[email protected]>
  • Loading branch information
jmberg-intel committed Nov 25, 2022
1 parent 9f16b5c commit acd3c92
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion net/wireless/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -2527,10 +2527,15 @@ cfg80211_inform_bss_frame_data(struct wiphy *wiphy,
const struct cfg80211_bss_ies *ies1, *ies2;
size_t ielen = len - offsetof(struct ieee80211_mgmt,
u.probe_resp.variable);
struct cfg80211_non_tx_bss non_tx_data;
struct cfg80211_non_tx_bss non_tx_data = {};

res = cfg80211_inform_single_bss_frame_data(wiphy, data, mgmt,
len, gfp);

/* don't do any further MBSSID handling for S1G */
if (ieee80211_is_s1g_beacon(mgmt->frame_control))
return res;

if (!res || !wiphy->support_mbssid ||
!cfg80211_find_elem(WLAN_EID_MULTIPLE_BSSID, ie, ielen))
return res;
Expand Down

0 comments on commit acd3c92

Please sign in to comment.