Linux wireless drivers development
 help / color / mirror / Atom feed
* [PATCH][RESEND] wifi: cfg80211: Do not create BSS entries for unsupported channels
@ 2024-09-23  2:16 Chenming Huang
  2024-09-23  7:29 ` Kalle Valo
  0 siblings, 1 reply; 3+ messages in thread
From: Chenming Huang @ 2024-09-23  2:16 UTC (permalink / raw)
  To: johannes; +Cc: linux-wireless

Currently, in cfg80211_parse_ml_elem_sta_data(), when RNR element
indicates a BSS that operates in a channel that current regulatory
domain doesn't support, a NULL value is returned by
ieee80211_get_channel_khz() and assigned to this BSS entry's channel
field. Later in cfg80211_inform_single_bss_data(), the reported
BSS entry's channel will be wrongly overridden by transmitted BSS's.
This could result in connection failure that when wpa_supplicant
tries to select this reported BSS entry while it actually resides in
an unsupported channel.

Since this channel is not supported, it is reasonable to skip such
entries instead of reporting wrong information.

Signed-off-by: Chenming Huang <quic_chenhuan@quicinc.com>
---
 net/wireless/scan.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/net/wireless/scan.c b/net/wireless/scan.c
index 59a90bf3c0d6..d0aed41ded2f 100644
--- a/net/wireless/scan.c
+++ b/net/wireless/scan.c
@@ -3050,6 +3050,10 @@ cfg80211_parse_ml_elem_sta_data(struct wiphy *wiphy,
 		freq = ieee80211_channel_to_freq_khz(ap_info->channel, band);
 		data.channel = ieee80211_get_channel_khz(wiphy, freq);
 
+		/* Skip if RNR element specifies an unsupported channel */
+		if (!data.channel)
+			continue;
+
 		/* Skip if BSS entry generated from MBSSID or DIRECT source
 		 * frame data available already.
 		 */
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-09-23  7:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-23  2:16 [PATCH][RESEND] wifi: cfg80211: Do not create BSS entries for unsupported channels Chenming Huang
2024-09-23  7:29 ` Kalle Valo
2024-09-23  7:34   ` Chenming Huang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox