diff mbox series

[17/19] wifi: mac80211: also verify requirements in EXT_SUPP_RATES

Message ID 20250101070249.f1840f19afa7.I12e3a0e634ce7014f5067256d9a6215fec6bf165@changeid (mailing list archive)
State Accepted
Delegated to: Johannes Berg
Headers show
Series wifi: mac80211: updates - 30-12-24 | expand

Commit Message

Miri Korenblit Jan. 1, 2025, 5:05 a.m. UTC
From: Benjamin Berg <benjamin.berg@intel.com>

Parse both the Supported Rates and BSS Membership Selectors as well as
the extended version of the tag when verifying whether we support all
features.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
---
 net/mac80211/mlme.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

Comments

kernel test robot Jan. 8, 2025, 7:55 a.m. UTC | #1
Hello,

kernel test robot noticed "hwsim.owe_assoc_reject.fail" on:

commit: 1539283361bfb9c62eb3486ded2c4d38e5858510 ("[PATCH 17/19] wifi: mac80211: also verify requirements in EXT_SUPP_RATES")
url: https://github.com/intel-lab-lkp/linux/commits/Miri-Korenblit/wifi-mac80211-add-some-support-for-RX-OMI-power-saving/20250101-131018
base: https://git.kernel.org/cgit/linux/kernel/git/wireless/wireless-next.git main
patch link: https://lore.kernel.org/all/20250101070249.f1840f19afa7.I12e3a0e634ce7014f5067256d9a6215fec6bf165@changeid/
patch subject: [PATCH 17/19] wifi: mac80211: also verify requirements in EXT_SUPP_RATES

in testcase: hwsim
version: hwsim-x86_64-4ea2c336d-1_20241103
with following parameters:

	test: owe_assoc_reject



config: x86_64-rhel-9.4-func
compiler: gcc-12
test machine: 8 threads 1 sockets Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz (Haswell) with 8G memory

(please refer to attached dmesg/kmsg for entire log/backtrace)




If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <oliver.sang@intel.com>
| Closes: https://lore.kernel.org/oe-lkp/202501081559.1c188f65-lkp@intel.com

group: group-00, test: owe_assoc_reject
2025-01-04 14:31:54 export USER=root
2025-01-04 14:31:54 ./build.sh
Building TNC testing tools
Building wlantest
Building hs20-osu-client
Building hostapd
Building wpa_supplicant
2025-01-04 14:32:44 ./start.sh
2025-01-04 14:32:45 ./run-tests.py owe_assoc_reject
DEV: wlan0: 02:00:00:00:00:00
DEV: wlan1: 02:00:00:00:01:00
DEV: wlan2: 02:00:00:00:02:00
APDEV: wlan3
APDEV: wlan4
START owe_assoc_reject 1/1
Test: Opportunistic Wireless Encryption association rejection handling
Starting AP wlan3
Connect STA wlan0 to AP
Association result not reported
Traceback (most recent call last):
  File "/lkp/benchmarks/hwsim/tests/hwsim/./run-tests.py", line 591, in main
    t(dev, apdev)
  File "/lkp/benchmarks/hwsim/tests/hwsim/test_owe.py", line 766, in test_owe_assoc_reject
    raise Exception("Association result not reported")
Exception: Association result not reported
FAIL owe_assoc_reject 13.055277 2025-01-04 14:32:59.681039
passed 0 test case(s)
skipped 0 test case(s)
failed tests: owe_assoc_reject
2025-01-04 14:32:59 ./stop.sh



The kernel config and materials to reproduce are available at:
https://download.01.org/0day-ci/archive/20250108/202501081559.1c188f65-lkp@intel.com
Benjamin Berg Jan. 8, 2025, 9:17 a.m. UTC | #2
Hi,

On Wed, 2025-01-08 at 15:55 +0800, kernel test robot wrote:
> Kernel test robot noticed "hwsim.owe_assoc_reject.fail" on:
> 
> commit: 1539283361bfb9c62eb3486ded2c4d38e5858510 ("[PATCH 17/19]
> wifi: mac80211: also verify requirements in EXT_SUPP_RATES")
> url:
> https://github.com/intel-lab-lkp/linux/commits/Miri-Korenblit/wifi-mac80211-add-some-support-for-RX-OMI-power-saving/20250101-131018
> base:
> https://git.kernel.org/cgit/linux/kernel/git/wireless/wireless-next.git
>  main
> patch link:
> https://lore.kernel.org/all/20250101070249.f1840f19afa7.I12e3a0e634ce7014f5067256d9a6215fec6bf165@changeid/
> patch subject: [PATCH 17/19] wifi: mac80211: also verify requirements
> in EXT_SUPP_RATES
> 
> in testcase: hwsim
> version: hwsim-x86_64-4ea2c336d-1_20241103
> with following parameters:
> 
> 	test: owe_assoc_reject

These failures happen because mac80211 has become more strict and the
hostap, including the hwsim tests, needs to be updated. The patchset to
update hostap is:
  https://patchwork.ozlabs.org/project/hostap/list/?series=439300

Benjamin
kernel test robot Jan. 9, 2025, 2:28 a.m. UTC | #3
hi, Benjamin,

On Wed, Jan 08, 2025 at 10:17:55AM +0100, Benjamin Berg wrote:
> Hi,
> 
> On Wed, 2025-01-08 at 15:55 +0800, kernel test robot wrote:
> > Kernel test robot noticed "hwsim.owe_assoc_reject.fail" on:
> > 
> > commit: 1539283361bfb9c62eb3486ded2c4d38e5858510 ("[PATCH 17/19]
> > wifi: mac80211: also verify requirements in EXT_SUPP_RATES")
> > url:
> > https://github.com/intel-lab-lkp/linux/commits/Miri-Korenblit/wifi-mac80211-add-some-support-for-RX-OMI-power-saving/20250101-131018
> > base:
> > https://git.kernel.org/cgit/linux/kernel/git/wireless/wireless-next.git
> >  main
> > patch link:
> > https://lore.kernel.org/all/20250101070249.f1840f19afa7.I12e3a0e634ce7014f5067256d9a6215fec6bf165@changeid/
> > patch subject: [PATCH 17/19] wifi: mac80211: also verify requirements
> > in EXT_SUPP_RATES
> > 
> > in testcase: hwsim
> > version: hwsim-x86_64-4ea2c336d-1_20241103
> > with following parameters:
> > 
> > 	test: owe_assoc_reject
> 
> These failures happen because mac80211 has become more strict and the
> hostap, including the hwsim tests, needs to be updated. The patchset to
> update hostap is:
>   https://patchwork.ozlabs.org/project/hostap/list/?series=439300

thanks a lot for information!

> 
> Benjamin
diff mbox series

Patch

diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 9735ce4adffe..d2ce5264923e 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -697,6 +697,8 @@  ieee80211_verify_sta_eht_mcs_support(struct ieee80211_sub_if_data *sdata,
 static void ieee80211_get_rates(struct ieee80211_supported_band *sband,
 				const u8 *supp_rates,
 				unsigned int supp_rates_len,
+				const u8 *ext_supp_rates,
+				unsigned int ext_supp_rates_len,
 				u32 *rates, u32 *basic_rates,
 				unsigned long *unknown_rates_selectors,
 				bool *have_higher_than_11mbit,
@@ -704,9 +706,12 @@  static void ieee80211_get_rates(struct ieee80211_supported_band *sband,
 {
 	int i, j;
 
-	for (i = 0; i < supp_rates_len; i++) {
-		int rate = supp_rates[i] & 0x7f;
-		bool is_basic = !!(supp_rates[i] & 0x80);
+	for (i = 0; i < supp_rates_len + ext_supp_rates_len; i++) {
+		u8 supp_rate = i < supp_rates_len ?
+				supp_rates[i] :
+				ext_supp_rates[i - supp_rates_len];
+		int rate = supp_rate & 0x7f;
+		bool is_basic = !!(supp_rate & 0x80);
 
 		if ((rate * 5) > 110 && have_higher_than_11mbit)
 			*have_higher_than_11mbit = true;
@@ -1027,6 +1032,7 @@  ieee80211_determine_chan_mode(struct ieee80211_sub_if_data *sdata,
 	sband = sdata->local->hw.wiphy->bands[channel->band];
 
 	ieee80211_get_rates(sband, elems->supp_rates, elems->supp_rates_len,
+			    elems->ext_supp_rates, elems->ext_supp_rates_len,
 			    NULL, NULL, unknown_rates_selectors, NULL, NULL,
 			    NULL);
 
@@ -5287,6 +5293,7 @@  static int ieee80211_mgd_setup_link_sta(struct ieee80211_link_data *link,
 	sband = local->hw.wiphy->bands[cbss->channel->band];
 
 	ieee80211_get_rates(sband, bss->supp_rates, bss->supp_rates_len,
+			    NULL, 0,
 			    &rates, &basic_rates, NULL,
 			    &have_higher_than_11mbit,
 			    &min_rate, &min_rate_index);