]> git.ipfire.org Git - thirdparty/hostap.git/log
thirdparty/hostap.git
7 months agoCheck last scan SSIDs before triggering new scan for hidden network
Arowa Suliman [Tue, 5 Nov 2024 05:36:11 +0000 (05:36 +0000)] 
Check last scan SSIDs before triggering new scan for hidden network

Commit 92374d59d4ef ("Enhance select_network() to trigger new scans in
some cases") introduced a redundant scan when selecting a hidden network
that was previously scanned and found. This occurs because the code only
checks for the condition `(wpa_s->no_suitable_network ||
wpa_s->last_scan_external)`, which doesn't cover the case where the last
scan successfully found the hidden SSID.

Save the scanned SSIDs from the last scan and updates the condition to
check if the hidden SSID was included. If the hidden SSID is not found
in `last_scan_ssids`, the code checks if the SSID was found in earlier
scan results. If not, it triggers a new scan. If the SSID is found, a
new scan is avoided, resulting in faster connection times.

Signed-off-by: Arowa Suliman <arowa@chromium.org>
7 months agoUpdate link to prplMesh repository
Jouni Malinen [Thu, 26 Dec 2024 22:34:00 +0000 (00:34 +0200)] 
Update link to prplMesh repository

The older github.com repository has been archived.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 months agoHandle CONFIG_NO_WPA for wpa_sm_has_ptk_installed()
Jouni Malinen [Thu, 26 Dec 2024 22:19:33 +0000 (00:19 +0200)] 
Handle CONFIG_NO_WPA for wpa_sm_has_ptk_installed()

There was no empty wrapper for wpa_sm_has_ptk_installed() for the
CONFIG_NO_WPA=y builds. The previously renamed wpa_sm_has_ptk() wrapper
was still in place even though it is not used anymore, so rename it to
cover this newer need.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 months agomka: Accept MKPDU sent to any multicast address
Tim Small [Wed, 23 Oct 2024 16:35:02 +0000 (17:35 +0100)] 
mka: Accept MKPDU sent to any multicast address

Improve MKPDU 802.1X conformance by not requiring the PAE group address
(01-80-C2-00-00-03) to be used as the destination, but instead, allowing
any multicast address to be used. IEEE Std 802.1X-2020, 11.11.2
(Validation of MKPDUs) disallows only individual addresses as the
destination address.

IEEE Sts 802.1X-2010 and 802.1X-2020 both specify that MKPDU packets
should be discarded if their destination address is "an individual
address". ieee802_1x_kay_mkpdu_validity_check() previously also rejected
all destination addresses other than 01:80:c2:00:00:03 "Nearest non-TPMR
Bridge group address" (in contradiction to its comments).

This restriction may be a carry-over from IEEE Std 802.1X-2004, but is
explicitly discouraged in the 2010 and 2020 revisions (see 11.1.1
(Destination MAC address) and its references).

The additional restriction prevented wpa_supplicant and hostapd from
participating in MACsec communication in environments such as
third-party ("supplier") layer 2 networks.

Signed-off-by: Tim Small <tim@seoss.co.uk>
7 months agotests: Make ap_cipher_tkip_countermeasures_sta2 more robust
Jouni Malinen [Thu, 26 Dec 2024 18:30:23 +0000 (20:30 +0200)] 
tests: Make ap_cipher_tkip_countermeasures_sta2 more robust

Work around a race condition between Michael MIC error report processing
on the AP from two STAs and the 4-way handshake that might get started,
but not necessarily completed, during that window.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 months agoOWE: Fix SSID comparison in transition mode case
Vinayak Yadawad [Fri, 13 Dec 2024 08:45:27 +0000 (14:15 +0530)] 
OWE: Fix SSID comparison in transition mode case

ret_ssid is a pointer to a pointer to the SSID and as such, it needs to
be referenced once here for the comparison just like ret_ssid_len. This
was broken recently as a part of duplicated code removal.

Fixes: ddfed3f08473 ("OWE: Reduce code duplication in OWE element parsing")
Signed-off-by: Vinayak Yadawad <vinayak.yadawad@broadcom.com>
7 months agotests: Opportunistic Wireless Encryption transition mode roaming
Jouni Malinen [Thu, 26 Dec 2024 10:14:25 +0000 (12:14 +0200)] 
tests: Opportunistic Wireless Encryption transition mode roaming

Signed-off-by: Jouni Malinen <j@w1.fi>
7 months agoOWE: Accept only BSS entries with an actual SSID for ROAM command
Jouni Malinen [Thu, 26 Dec 2024 10:30:22 +0000 (12:30 +0200)] 
OWE: Accept only BSS entries with an actual SSID for ROAM command

An AP in OWE transition mode shows up in the BSS table twice due to use
of the hidden SSID. Since roaming requires the SSID to be known, don't
select the BSS entry with an empty SSID to force the one with the actual
SSID to be used when using the ROAM command to roam between APs that
might use OWE transition mode.

Fixes: 56e8f8bf3490 ("OWE: Enable roaming between OWE APs")
Signed-off-by: Jouni Malinen <j@w1.fi>
7 months agonl80211: Use wpa_msg() to report netlink errors
Ben Greear [Wed, 10 Jul 2024 18:37:11 +0000 (11:37 -0700)] 
nl80211: Use wpa_msg() to report netlink errors

This allows errors to be propagated to listeners instead of
just buried in the logs.

Signed-off-by: Ben Greear <greearb@candelatech.com>
7 months agonl80211: Make drv pointer available to send_and_recv()
Ben Greear [Wed, 10 Jul 2024 18:37:11 +0000 (11:37 -0700)] 
nl80211: Make drv pointer available to send_and_recv()

This is needed to allow wpa_msg() to be used to report kernel errors.

Signed-off-by: Ben Greear <greearb@candelatech.com>
7 months agohostapd: Respect obss_interval on 40 MHz intolerant disconnect
Nicolas Escande [Mon, 29 Apr 2024 10:13:25 +0000 (12:13 +0200)] 
hostapd: Respect obss_interval on 40 MHz intolerant disconnect

When an AP is configured for HT operation on 40 MHz but has overlapping
BSS on the secondary channel, it will fall back to 20 MHz only. Also a
40 MHz AP will downgrade to 20 MHz while at least one 40 MHz intolerant
STA is connected.

However, in the current code, on such an AP, we do not check the
obss_interval parameter to be set on the last 40 MHz intolerant STA
disconnect and instead, start a timer that will unconditionnaly and
immediately bring the AP to 40 MHz operation even if it had overlapping
BSS.

A similar case was addressed for the 20/40 MHz co-ex report earlier in
commit d027c7b118fe ("Fix 20/40 MHz co-ex report processing with
obss_interval=0"), but this other case that gets called whenever a STA
entry is removed needs to have similar constraint on starting the timer.

Signed-off-by: Nicolas Escande <nico.escande@gmail.com>
7 months agotests: Set obss_interval for the test that verifies return to 40 MHz
Jouni Malinen [Wed, 25 Dec 2024 17:11:11 +0000 (19:11 +0200)] 
tests: Set obss_interval for the test that verifies return to 40 MHz

This is in preparation for changing hostapd to require obss_interval to
be set to allow the channel bandwidth to be increased from 20 MHz to 40
MHz on disassociation of the last 40 MHz intolerant STA.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 months agotests: Enable NAN_USD hwsim tests
Andrei Otcheretianski [Tue, 26 Nov 2024 09:10:20 +0000 (11:10 +0200)] 
tests: Enable NAN_USD hwsim tests

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
7 months agotests: Add a couple of P2P2 pairing tests with P2P device
Andrei Otcheretianski [Tue, 26 Nov 2024 09:10:19 +0000 (11:10 +0200)] 
tests: Add a couple of P2P2 pairing tests with P2P device

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
7 months agotests: Support parsing group formation events without password
Andrei Otcheretianski [Tue, 26 Nov 2024 09:10:18 +0000 (11:10 +0200)] 
tests: Support parsing group formation events without password

P2P2 clients don't acquire group password with PASN SAE pairing. Support
parsing GROUP-STARTED events without password.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
7 months agotests: Properly cancel NAN publish/subscribe
Andrei Otcheretianski [Tue, 26 Nov 2024 09:10:17 +0000 (11:10 +0200)] 
tests: Properly cancel NAN publish/subscribe

Wrong command was used. Fix it.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
7 months agotests: Use global interface for P2P2 tests
Andrei Otcheretianski [Tue, 26 Nov 2024 09:10:16 +0000 (11:10 +0200)] 
tests: Use global interface for P2P2 tests

These commands should be redirected to P2P device interace, thus use
global interface both for USD and pairing commands.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
7 months agoP2P2: Use global interface for USD
Andrei Otcheretianski [Tue, 26 Nov 2024 09:10:15 +0000 (11:10 +0200)] 
P2P2: Use global interface for USD

Redirect NAN USD command and events to global interface, so it can be
used for P2P.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
7 months agonl80211: Allow PASN Authentication frames on P2P device interface
Andrei Otcheretianski [Tue, 26 Nov 2024 09:10:14 +0000 (11:10 +0200)] 
nl80211: Allow PASN Authentication frames on P2P device interface

This is required for PASN based pairing used in P2P2.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
7 months agoP2P2: Fix frequency selection for auto GO join
Andrei Otcheretianski [Tue, 26 Nov 2024 09:10:13 +0000 (11:10 +0200)] 
P2P2: Fix frequency selection for auto GO join

When reusing an existing GO for pairing, force its frequency in GO
negotiation.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
7 months agoP2P2: Make sure password is set when using non opportunistic methods
Andrei Otcheretianski [Tue, 26 Nov 2024 09:10:12 +0000 (11:10 +0200)] 
P2P2: Make sure password is set when using non opportunistic methods

Otherwise the flow would continue, eventually falling back to PASN
method instead of SAE even if not allowed in PBMA.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
7 months agoP2P2: Report R2 information in P2P-DEVICE-FOUND event
Andrei Otcheretianski [Tue, 26 Nov 2024 09:10:11 +0000 (11:10 +0200)] 
P2P2: Report R2 information in P2P-DEVICE-FOUND event

Add PCEA capability information, supported PASN types, and bootstrap
methods in P2P-DEVICE-FOUND event. This is needed to be able to start
P2P2 pairing with the discovered peer.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
7 months agoNAN: Remove excessive debug print about the next timer
Andrei Otcheretianski [Tue, 26 Nov 2024 09:10:10 +0000 (11:10 +0200)] 
NAN: Remove excessive debug print about the next timer

As it polutes the log too much.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
7 months agowpa_cli: Support NAN USD commands
Andrei Otcheretianski [Mon, 9 Dec 2024 16:12:10 +0000 (18:12 +0200)] 
wpa_cli: Support NAN USD commands

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
7 months agoNAN: Fix A3 for unicast P2P2 USD
Andrei Otcheretianski [Thu, 19 Dec 2024 09:18:50 +0000 (11:18 +0200)] 
NAN: Fix A3 for unicast P2P2 USD

According to the Wi-Fi Direct spec draft, address 3 in unicast USD
frames shall be set to the P2P Device Address of the sender (i.e., this
differs from the Wi-Fi Aware specification). Fix it.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
7 months agoNAN: Fix A3 for multicast P2P2 USD
Andrei Otcheretianski [Thu, 19 Dec 2024 09:18:50 +0000 (11:18 +0200)] 
NAN: Fix A3 for multicast P2P2 USD

According to the Wi-Fi Direct spec draft, address 3 in multicast USD
frames shall be set to wildcard BSSID (i.e., this differs from the Wi-Fi
Aware specification). Fix it.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
7 months agotests: ML association based on scanning only the second link
Jouni Malinen [Mon, 23 Dec 2024 10:33:42 +0000 (12:33 +0200)] 
tests: ML association based on scanning only the second link

This increases testing coverage for MLO by having to use ML probe for
missing links and using link ID for association.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 months agoSend CTRL-EVENT-SIGNAL-CHANGE message to control interfaces only
Kan-Ru Chen [Sun, 22 Dec 2024 23:42:33 +0000 (08:42 +0900)] 
Send CTRL-EVENT-SIGNAL-CHANGE message to control interfaces only

The default logging level for the CTRL-EVENT-SIGNAL-CHANGE message
may be repeated many times and fill the log file or journal.

For example https://bugzilla.redhat.com/show_bug.cgi?id=2309148 and
the first few results from searching CTRL-EVENT-SIGNAL-CHANGE on the
web contain various complaints and workarounds.

Change the logging method to wpa_msg_ctrl to avoid sending frequent
messages to the syslog but still allow the message to be consumed by
control interface monitors.

Signed-off-by: Kan-Ru Chen <kanru@kanru.info>
7 months agotests: Additional test case to UML-issues-list
Jouni Malinen [Sun, 22 Dec 2024 23:01:08 +0000 (01:01 +0200)] 
tests: Additional test case to UML-issues-list

Signed-off-by: Jouni Malinen <j@w1.fi>
7 months agotests: Split hostapd_oom_wpa2_eap_connect into multiple test cases
Jouni Malinen [Sun, 22 Dec 2024 22:55:09 +0000 (00:55 +0200)] 
tests: Split hostapd_oom_wpa2_eap_connect into multiple test cases

This test case could take a long time to execute and it can be easily
split into a set of test cases that each cover a smaller range of
iterations (50 each for now). This is more robust and more efficient for
parallel VMs.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 months agohostapd: hostapd_cleanup_iface_partial: Fix hw_features use after free
Petr Štetiar [Wed, 18 Dec 2024 07:50:18 +0000 (07:50 +0000)] 
hostapd: hostapd_cleanup_iface_partial: Fix hw_features use after free

Currently when the iface is being cleaned up, the
hostapd_free_hw_features() is called which frees the underlying
hw_features and the struct is being NULLed, but the num_hw_features
counter is not being reset, thus following commonly used access
constructs:

   for (i = 0; i < iface->num_hw_features; i++)
            acs_cleanup_mode(&iface->hw_features[i]);

This might then lead to use after free and hostapd for example might
crash during configuration reload on disabled interfaces:

  $ hostapd -ddt /tmp/wlan2_hapd.conf &
  $ hostapd_cli -i wlan2 raw DISABLE

  Fri Oct  4 20:44:04 2024 1728074644.706408: wlan2: AP-DISABLED

  $ kill -SIGHUP $(pidof hostapd)
  Segmentation fault (core dumped) hostapd -ddt /tmp/wlan2_hapd.conf

So lets fix it by resetting the num_hw_features counter to 0, so the
code will not try to access the freed memory in hw_features struct.

Reported-by: Mohammed SI ALI <mohammed.siali@softathome.com>
Tested-by: Houssem Dafdouf <houssem.dafdouf_ext@softathome.com>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
Signed-off-by: Petr Štetiar <petr.stetiar@prplfoundation.org>
7 months agoAndroid: Wrap a P2P-specific chunk in CONFIG_P2P
Matthew Wang [Thu, 5 Dec 2024 10:11:16 +0000 (10:11 +0000)] 
Android: Wrap a P2P-specific chunk in CONFIG_P2P

This special driver_cmd handling is specific for P2P and won't compile
without CONFIG_P2P=y.

Signed-off-by: Matthew Wang <matthewmwang@chromium.org>
7 months agoEAPOL: Fix PMK setting for driver-based FT-SHA384
Vinayak Yadawad [Wed, 4 Dec 2024 09:13:59 +0000 (14:43 +0530)] 
EAPOL: Fix PMK setting for driver-based FT-SHA384

Currently in eapol callback PMK update for FT is done wrongly with the
default PMK length even in case of SHA384. SHA384 needs longer 48-octet
PMK. Accordingly, fix the offset and length of the PMK that is
configured to the driver for driver-based FT.

Signed-off-by: Vinayak Yadawad <vinayak.yadawad@broadcom.com>
7 months agoDPP: Handle EVENT_TX_WAIT_EXPIRE path for push button
andrewrpope [Mon, 25 Nov 2024 21:11:52 +0000 (08:11 +1100)] 
DPP: Handle EVENT_TX_WAIT_EXPIRE path for push button

The DPP push button state machine will get stuck if an off-channel PB
announcement is cancelled via EVENT_TX_WAIT_EXPIRE. Handle a
TX_WAIT_EXPIRE by calling wpas_dpp_pb_next(), moving the state machine
forward.

Signed-off-by: Andrew Pope <andrew.pope@morsemicro.com>
7 months agotests: Remove setting of the now removed p2p_pairing_verification
Jouni Malinen [Sun, 22 Dec 2024 21:40:05 +0000 (23:40 +0200)] 
tests: Remove setting of the now removed p2p_pairing_verification

Signed-off-by: Jouni Malinen <j@w1.fi>
7 months agoP2P2: Remove redundant enable_pairing_verification flag
Andrei Otcheretianski [Sun, 13 Oct 2024 12:45:23 +0000 (15:45 +0300)] 
P2P2: Remove redundant enable_pairing_verification flag

This is a duplicate of enable_pairing_cache flag. Remove it.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
7 months agoFix using invalid memory during driver deinit
Ming Kuang [Mon, 23 Sep 2024 15:25:29 +0000 (23:25 +0800)] 
Fix using invalid memory during driver deinit

The address of hapd_iface->bss[0]->drv_priv is stored before calling
hostapd_free_hapd_data() and then passed to hostapd_deinit_driver()
after the call. However, hostapd_free_hapd_data() may free the
hapd->drv_priv memory, which could lead to hostapd_deinit_driver() using
an invalid memory address that has already been freed.

Commit 7554565299a1 ("hostapd: Add ctrl_iface for
enabling/reloading/disabling interface") added this split design of
storing a copy of driver/drv_priv before some deinit steps and then
using the stored values. That was likely done based on the earlier
examples of similar split which was needed in some cases a long time ago
before commit f7c478337957 ("Split hostapd_interface_deinit() into
deinit and free parts") when hostapd_interface_deinit() freed bss[0] and
as such, those pointers could not have been used without making the
separate copy first. That is not needed anymore, so get rid of it here.

Signed-off-by: Ming Kuang <ming@imkuang.com>
7 months agoUpdate STA authorized flag for AP SME in driver cases for open network
Jouni Malinen [Sun, 22 Dec 2024 21:04:51 +0000 (23:04 +0200)] 
Update STA authorized flag for AP SME in driver cases for open network

With AP SME in hostapd/wpa_supplicant, TX status handler for
(Re)Association Response frame takes care of this, but with AP SME in
driver cases, ap_sta_set_authorized(1) is not sufficient to update the
driver flags for the STA, so cover that case as well.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 months agotests: MAke sae_anti_clogging_during_attack more robust
Jouni Malinen [Sun, 22 Dec 2024 17:44:24 +0000 (19:44 +0200)] 
tests: MAke sae_anti_clogging_during_attack more robust

Reset apdev[1] into a known state before using it as montior interface
since issues have been seen when the previous test case used it as a 5
GHz AP. In addition, handle sock.recv() timeout more gracefully.

For example, this test case sequences had issues:
ap_track_sta_force_2ghz sae_anti_clogging_during_attack
he160b sae_anti_clogging_during_attack

Signed-off-by: Jouni Malinen <j@w1.fi>
7 months agoFix CONFIG_NO_STDOUT_DEBUG=y build
Ameer Antar [Sat, 28 Sep 2024 22:52:06 +0000 (18:52 -0400)] 
Fix CONFIG_NO_STDOUT_DEBUG=y build

When building with the no std output setting (CONFIG_NO_STDOUT_DEBUG),
the build fails with an undefined reference for wpa_debug_stop_log().
Define this as an empty function along with the others at the top of
wpa_debug.h in case no std out is configured.

Signed-off-by: Ameer Antar <ameerantar@comcast.net>
7 months agoFix sae_pk_gen compilation
Ameer Antar [Sat, 28 Sep 2024 02:27:28 +0000 (22:27 -0400)] 
Fix sae_pk_gen compilation

The Makefile is not properly set up to compile the sae_pk_gen target.
Enabling CONFIG_SAE=y and CONFIG_SAE_PK=y in the configuration is not
sufficient to compile. The linker complains about undefined references.
These additions must be made to the Makefile to get it to compile, at
least with gcc. Once this is done, 'make sae_pk_gen' can be run without
issue.

Signed-off-by: Ameer Antar <ameerantar@comcast.net>
7 months agoInclude base64 for hostapd CONFIG_SAE_PK builds
Jouni Malinen [Sun, 22 Dec 2024 16:53:12 +0000 (18:53 +0200)] 
Include base64 for hostapd CONFIG_SAE_PK builds

CONFIG_SAE_PK=y needs base64 functionality, so set NEED_BASE64
automatically for it.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 months agotests: External password (file) storage for PSK with hash
Jouni Malinen [Sun, 22 Dec 2024 16:35:43 +0000 (18:35 +0200)] 
tests: External password (file) storage for PSK with hash

Signed-off-by: Jouni Malinen <j@w1.fi>
7 months agoext_password_file: Do not use wpa_config_get_line()
rnhmjoj [Wed, 18 Sep 2024 13:58:25 +0000 (15:58 +0200)] 
ext_password_file: Do not use wpa_config_get_line()

The file-based backed of the ext_password framework uses
wpa_config_get_line() to read the passwords line-by-line from a file.
This function is meant to parse a single line from the
wpa_supplicant.conf file, so it handles whitespace, quotes and other
characters specially.

Its behavior, however, it's not compatible with the rest of the
ext_password framework implementation. For example, if a passphrase
contains a `#` character it must be quoted to prevent parsing the
remaining characters as an inline comment, but the code handling the
external password in wpa_supplicant_get_psk() does not handle quotes.
The result is that either it will hash the enclosing quotes, producing a
wrong PSK, or if the passphrase is long enough, fail the length check.
As a consequence, some passphrases are impossible to input correctly.

To solve this and other issues, this patch changes the behaviour of the
ext_password_file_get() function (which was not documented in details,
at least w.r.t. special characters) to simply treat all characters
literally: including trailing whitespaces (except CR and LF), `#` for
inline comments, etc. Empty lines and full-line comments are still
supported.

Signed-off-by: Michele Guerini Rocco <rnhmjoj@inventati.org>
7 months agoFix the documentation of SignalPoll method
Kaidong Wang [Tue, 17 Sep 2024 23:00:20 +0000 (23:00 +0000)] 
Fix the documentation of SignalPoll method

Method SignalPoll wraps the dictionary of properties in a variant
container, update the documentation to reflect the wrapping.

Signed-off-by: Kaidong Wang <kaidong@chromium.org>
7 months agoFix nan_usd linker error
Matthew Wang [Tue, 17 Sep 2024 16:33:40 +0000 (16:33 +0000)] 
Fix nan_usd linker error

nan_usd requires offchannel. Require NEED_OFFCHANNEL=y when
CONFIG_NAN_USD is set.

Signed-off-by: Matthew Wang <matthewmwang@chromium.org>
7 months agoComment out WPA related code additions with CONFIG_NO_WPA
Jouni Malinen [Sun, 22 Dec 2024 16:22:10 +0000 (18:22 +0200)] 
Comment out WPA related code additions with CONFIG_NO_WPA

These broke CONFIG_NO_WPA=y builds due to dependencies to
src/common/wpa_common.c functionality.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 months agoUse consistent ifdef CONFIG_NO_WPA blocks
Jouni Malinen [Sun, 22 Dec 2024 16:17:19 +0000 (18:17 +0200)] 
Use consistent ifdef CONFIG_NO_WPA blocks

This is needed to avoid compiler warnings about unused static functions.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 months agoAdd empty inline functions for CONFIG_NO_WPA
Jouni Malinen [Sun, 22 Dec 2024 16:16:32 +0000 (18:16 +0200)] 
Add empty inline functions for CONFIG_NO_WPA

These recently added functions were used outside ifder CONFIG_NO_WPA, so
they need to have the empty inline functions in wpa.h to avoid
compilation issues.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 months agoFix CONFIG_NO_WPA compile/link errors related to RSNXE
Matthew Wang [Tue, 17 Sep 2024 16:33:39 +0000 (16:33 +0000)] 
Fix CONFIG_NO_WPA compile/link errors related to RSNXE

Enabling CONFIG_NO_WPA causes some errors. Fix them.

Signed-off-by: Matthew Wang <matthewmwang@chromium.org>
7 months agoAdd a top-level Makefile
Tomas Paukrt [Tue, 17 Sep 2024 05:14:08 +0000 (07:14 +0200)] 
Add a top-level Makefile

Add a top-level Makefile to make cross-compilation easier under
various build systems.

Signed-off-by: Tomas Paukrt <tomaspaukrt@email.cz>
7 months agoInclude HMAC-SHA384/512 KDF for SAE if SHA384/512 is included
Tomas Paukrt [Tue, 17 Sep 2024 05:13:27 +0000 (07:13 +0200)] 
Include HMAC-SHA384/512 KDF for SAE if SHA384/512 is included

It was possible to miss the HMAC functions if some other build
configuration parameters ended up setting NEED_SHA384/512=y.

Signed-off-by: Tomas Paukrt <tomaspaukrt@email.cz>
7 months agotests: Clean up subprocess.Popen() uses for helper functions
Jouni Malinen [Sun, 22 Dec 2024 10:20:25 +0000 (12:20 +0200)] 
tests: Clean up subprocess.Popen() uses for helper functions

Use communicate() to properly wait for the process to terminate.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 months agotests: Stop hlr_auc_gw more cleanly
Jouni Malinen [Sun, 22 Dec 2024 11:26:25 +0000 (13:26 +0200)] 
tests: Stop hlr_auc_gw more cleanly

Use the new TERMINATE command through the socket to stop hlr_auc_gw
instead of depending on killall. There seemed to be some kind of race
condition with UML that could prevent cleanup previously.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 months agohlr_auc_gw: Add TERMINATE command
Jouni Malinen [Sun, 22 Dec 2024 11:24:14 +0000 (13:24 +0200)] 
hlr_auc_gw: Add TERMINATE command

The new TERMINATE command can be used to terminate hlr_auc_gw more
cleanly without having to use signals.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 months agotests: Use correct VM index for prints of unexpected messages
Jouni Malinen [Sun, 22 Dec 2024 11:09:15 +0000 (13:09 +0200)] 
tests: Use correct VM index for prints of unexpected messages

Signed-off-by: Jouni Malinen <j@w1.fi>
7 months agotests: Write remaining processes and ports into a file
Jouni Malinen [Sun, 22 Dec 2024 10:44:17 +0000 (12:44 +0200)] 
tests: Write remaining processes and ports into a file

This can be helpful for debugging test failures due to something not
getting terminated properly.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 months agotests: Stop sigma_dut stated hostapd based on ap_reset_default
Jouni Malinen [Sun, 22 Dec 2024 10:19:15 +0000 (12:19 +0200)] 
tests: Stop sigma_dut stated hostapd based on ap_reset_default

Previously, this was done only based on ap_config_commit, but sigma_dut
might start hostapd even without that command, e.g., when using DPP.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 months agoAP MLD: Do not try to set hapd->mld multiple times
Jouni Malinen [Sun, 22 Dec 2024 08:49:27 +0000 (10:49 +0200)] 
AP MLD: Do not try to set hapd->mld multiple times

Now that there is more than one path that could end up calling
hostapd_bss_setup_multi_link(), it looks like it was possible to end up
allocating the MLD context twice and that resulted in resource leaks.
Avoid this by explicitly checking that hapd->mld is not set before
trying to determine whether to set it to an existing context or create a
new one.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 months agotests: Remove duplicated listing of a long test case
Jouni Malinen [Sun, 22 Dec 2024 08:42:49 +0000 (10:42 +0200)] 
tests: Remove duplicated listing of a long test case

Signed-off-by: Jouni Malinen <j@w1.fi>
7 months agotests: Make country code clearing in dbus_interface more robust
Jouni Malinen [Sat, 21 Dec 2024 20:31:07 +0000 (22:31 +0200)] 
tests: Make country code clearing in dbus_interface more robust

Wait for the specific CTRL-EVENT-REGDOM-CHANGE events to try to avoid
test failures due to some race conditions and the US country code being
left effective at the end of the test case.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 months agotests: More test cases with common UML issues to the front of the queue
Jouni Malinen [Sat, 21 Dec 2024 20:25:57 +0000 (22:25 +0200)] 
tests: More test cases with common UML issues to the front of the queue

Move test cases that have shown frequent, but random, issues UML to the
beginning of the run to minimize risk of false failures.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 months agotests: More robust way of killing hung UML VMs
Jouni Malinen [Sat, 21 Dec 2024 10:19:03 +0000 (12:19 +0200)] 
tests: More robust way of killing hung UML VMs

The uml_mconsole halt command may hang when trying to terminate a hung
UML VM, so check for a timeout on that operation and kill the UML
process directly if that happens. In addition, do not try to terminate a
specific VM more than once to avoid confusing debug log entries.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 months agohostapd: Fix wrong puncturing bitmap in Bandwidth Indication subelement
Allen Ye [Thu, 5 Sep 2024 05:55:30 +0000 (13:55 +0800)] 
hostapd: Fix wrong puncturing bitmap in Bandwidth Indication subelement

The Bandwidth Indication subelement should present the puncturing bitmap
of channel switch request, but the bitmap returned by
hostapd_get_punct_bitmap() is the original one.

Co-developed-by: Money Wang <money.wang@mediatek.com>
Signed-off-by: Allen Ye <allen.ye@mediatek.com>
7 months agohostapd: Move punct_bitmap into hostapd_freq_params
Allen Ye [Thu, 5 Sep 2024 05:55:29 +0000 (13:55 +0800)] 
hostapd: Move punct_bitmap into hostapd_freq_params

Move punct_bitmap into hostapd_freq_params to allow hostapd_data structure
to access the new puncturing bitmap during a channel switch.

Co-developed-by: Money Wang <money.wang@mediatek.com>
Signed-off-by: Allen Ye <allen.ye@mediatek.com>
7 months agohostapd: Fix length of Bandwidth Indication subelement
Shayne Chen [Thu, 5 Sep 2024 05:55:28 +0000 (13:55 +0800)] 
hostapd: Fix length of Bandwidth Indication subelement

The default length of the Bandwidth Indication subelement should be
equal to the minimum size of ieee80211_bw_ind_element structure. The
previously used value truncated this subelement by one octet.

Fixes: c7e704bdf9c3 ("hostapd: Add Bandwidth Indication subelement support for channel switch")
Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
Signed-off-by: Allen Ye <allen.ye@mediatek.com>
7 months agoAvoid EAPOL trigger in reassoc path for AP with 4-way handshake offload
Vinayak Yadawad [Wed, 4 Sep 2024 11:11:30 +0000 (16:41 +0530)] 
Avoid EAPOL trigger in reassoc path for AP with 4-way handshake offload

Currently avoiding of EAPOL exchange for AP with 4-way handshake offload
is handled only in the new STA assoc path. Extended this to cover
skipping authentication trigger in case reassoc path without
disconnection as well.

Signed-off-by: Vinayak Yadawad <vinayak.yadawad@broadcom.com>
7 months agoAP MLD: Fix a crash in hostapd_driver_init()
Andrei Otcheretianski [Sun, 1 Sep 2024 16:31:35 +0000 (19:31 +0300)] 
AP MLD: Fix a crash in hostapd_driver_init()

In case of an AP MLD it is assumed that the multi link information
(hapd->mld) is already initialized by the time this function is called.
However, if the interface is added without bss_config parameter,
hostapd_bss_setup_multi_link() would bail out immediately as mld_ap
parameter isn't set yet. When the interface gets enabled later,
hapd->mld would be NULL resulting in NULL dereference.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
7 months agoBSS: MLD: Parse all TBTT entries after an invalid link
Benjamin Berg [Sun, 1 Sep 2024 16:31:34 +0000 (19:31 +0300)] 
BSS: MLD: Parse all TBTT entries after an invalid link

We would incorrectly exit the loop that iterates all TBTT entries if an
entry is found with an invalid link ID. This commonly happens if the AP
reports a link for another AP (or just another AP in the same MBSSID
set). Change it to continue with the next TBTT entry so that all entries
are parsed and all links can be found.

Fixes: de5e01010cb2 ("wpa_supplicant: Support ML probe request")
Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
7 months agoBSS: MLD: Limit TBTT parsing to correct length
Benjamin Berg [Sun, 1 Sep 2024 16:31:33 +0000 (19:31 +0300)] 
BSS: MLD: Limit TBTT parsing to correct length

Logically, it makes more sense to pass the ap_info_len as that is the
length that the function is permitted to process. Effectively it does
not make a difference and the code was entirely safe, but change it
nontheless to be more correct.

Fixes: de5e01010cb2 ("wpa_supplicant: Support ML probe request")
Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
7 months agoP2P: Consult driver capabilities before setting HE bit in GO's conf
Jintao Lin [Wed, 7 Aug 2024 21:48:01 +0000 (21:48 +0000)] 
P2P: Consult driver capabilities before setting HE bit in GO's conf

p2p_go_he could be set to 1 in the global config file while the device
might only has a VHT Wi-Fi NIC. Consult driver capabilities before
setting the HE bit for the GO's configuration so that latter AP
configuration does not fail due to wrong AP configuration, like
hostapd_get_oper_centr_freq_seg0_idx().

This config bit is checked and set in wpa_supplicant_conf_ap_ht() based
on a more recent commit 3459c54ac78b ("mesh: Add support for HE mode"),
Thus there is no need to override this bit specifically for P2P GO using
this older approach.

Signed-off-by: Jintao Lin <jintaolin@chromium.org>
7 months agotests: Add more test cases to long_tests due to UML delays
Jouni Malinen [Thu, 19 Dec 2024 23:17:47 +0000 (01:17 +0200)] 
tests: Add more test cases to long_tests due to UML delays

These seem to be able to hang UML for some unknown reason, so try to run
them at the beginning of the sequence as a workaround.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
7 months agotests: Clear AP scan cache in prefer_ht40
Jouni Malinen [Thu, 19 Dec 2024 23:06:57 +0000 (01:06 +0200)] 
tests: Clear AP scan cache in prefer_ht40

It was possible for the HT40+ AP to fail to start 40 MHz channel due to
a conflicting AP in the scan results from a previous test case. This
happened, e.g., with the following test case sequence:
olbc prefer_ht40

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
7 months agotests: Disconnect after OCV tests showing valid OCI
Jouni Malinen [Thu, 19 Dec 2024 22:45:25 +0000 (00:45 +0200)] 
tests: Disconnect after OCV tests showing valid OCI

These test cases that used external EAPOL handling to test hostapd
behavior left the STA in associated state at the end and that could
result in race conditions showing up as a new association related event
in the following test case. Minimize risk of that resulting in test case
failures by explicit disconnecting at the end of the test case.

This was found with this test case sequence:
autogo_many wpa2_ocv_ap_unexpected1 wpa2_ocv_sta_override_eapol

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
7 months agotests: Fix rare EAPOL frame ID wrap-around failure
Benjamin Berg [Fri, 27 Sep 2024 09:36:22 +0000 (11:36 +0200)] 
tests: Fix rare EAPOL frame ID wrap-around failure

In rare cases ieee8021x_set_conf would fail as the ID of the EAPOL frame
wrapped around and the frame was not ignored as expected.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
7 months agotests: Insert sleep after DATA_TEST_FRAME where needed
Benjamin Berg [Fri, 27 Sep 2024 09:36:21 +0000 (11:36 +0200)] 
tests: Insert sleep after DATA_TEST_FRAME where needed

If the frame is not fully processed the neighbor entries of the bridge
will not yet be updated. Add a sleep to ensure that the tests are not
racy.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
7 months agotests: Fix race condition in fst_setup_mbie_diff
Benjamin Berg [Fri, 27 Sep 2024 09:36:20 +0000 (11:36 +0200)] 
tests: Fix race condition in fst_setup_mbie_diff

The allocation failure could be checked before the operation had
completed. Fix this by enabling the wait in the call to fst_setup_req.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
7 months agomesh: Use the correct 6 GHz operating class 137 for 320 MHz bandwidth
Maharaja Kennadyrajan [Tue, 17 Dec 2024 06:57:20 +0000 (12:27 +0530)] 
mesh: Use the correct 6 GHz operating class 137 for 320 MHz bandwidth

The 320 MHz case was not yet handled for setting the global operating
class for mesh in the 6 GHz band. That needs to use the operating class
137 instead of the default 131.

Signed-off-by: Maharaja Kennadyrajan <quic_mkenna@quicinc.com>
7 months agoAP: Support disconnect with MLD
Chenming Huang [Tue, 24 Sep 2024 08:15:42 +0000 (13:45 +0530)] 
AP: Support disconnect with MLD

When requested to disconnect a station also handle the corresponding MLD
stations. This was previously done in commit c6f519ff15b2 ("AP: Support
deauthenticate/disassociate with MLD") for ap_sta_disassociate() and
ap_sta_deauthenticate(), but similar handling is needed for
ap_sta_disconnect() as well to cover some disconnection cases especially
from the Authenticator functionality.

Signed-off-by: Chenming Huang <quic_chenhuan@quicinc.com>
7 months agotests: AP MLD and GTK rekeying failure with two link MLD client
Jouni Malinen [Thu, 19 Dec 2024 21:15:46 +0000 (23:15 +0200)] 
tests: AP MLD and GTK rekeying failure with two link MLD client

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
7 months agoP2P: Check P2P 6 GHz capability to start P2P GO
Shivani Baranwal [Tue, 10 Dec 2024 09:51:37 +0000 (15:21 +0530)] 
P2P: Check P2P 6 GHz capability to start P2P GO

Currently, when no forced channel frequency is included with the start
an autonomous P2P GO command, a 6 GHz channel might get selected if it
is a shared radio frequency irrespective of P2P 6 GHz capability. In
these cases we need to check whether P2P 6 GHz capability is supported
before proceeding with P2P GO start on a 6 GHz channel.

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
7 months agoAdd QCA vendor attributes to configure antenna selection
Wu Gao [Fri, 13 Dec 2024 07:16:24 +0000 (23:16 -0800)] 
Add QCA vendor attributes to configure antenna selection

Add following attributes to configure antenna selection:
  QCA_WLAN_VENDOR_ATTR_CONFIG_ANT_DIV_PROBE_COUNT_WLAN
  QCA_WLAN_VENDOR_ATTR_CONFIG_ANT_DIV_PROBE_COUNT_BT
  QCA_WLAN_VENDOR_ATTR_CONFIG_ANT_DIV_PROBE_WLAN_RSSI_THRESHOLD
  QCA_WLAN_VENDOR_ATTR_CONFIG_ANT_DIV_PROBE_BT_RSSI_THRESHOLD
  QCA_WLAN_VENDOR_ATTR_CONFIG_ANT_DIV_SWITCH_WLAN_RSSI_DIFF
  QCA_WLAN_VENDOR_ATTR_CONFIG_ANT_DIV_SWITCH_BT_RSSI_DIFF

If WLAN or BT RSSI is lower than the threshold, the firmware will start
a probe and then get RSSI of other antenna, and then select a better
antenna if RSSI difference is larger than the setting.

Signed-off-by: Wu Gao <quic_wugao@quicinc.com>
7 months agotests: Add some more longer duration test cases to long_tests
Jouni Malinen [Wed, 18 Dec 2024 11:07:43 +0000 (13:07 +0200)] 
tests: Add some more longer duration test cases to long_tests

These test cases seemed to take longer time with UML time-travel and it
is more efficient to run them in the beginning of the test sequence to
avoid leaving a single VM delaying completion of a parallel test run
with large number of VMs. In addition, it looks like some of these test
cases are much more reliable and faster to run at the beginning of a VM
lifetime than at the end.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
7 months agotests: Terminate UML VM automatically if it seems to have stopped
Jouni Malinen [Wed, 18 Dec 2024 10:43:32 +0000 (12:43 +0200)] 
tests: Terminate UML VM automatically if it seems to have stopped

There have been number of cases in which a UML VM seems to hang. Make
parallel-vm.py track how long it has been since last stdout input from a
VM and terminate the VM using uml_mconsole if there has been no updates
in ten seconds. This is in use only with UML, i.e., only if time-travel
is enabled, so 120 seconds of real calendar time should be enough time
for any test case to be completed.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
7 months agotests: Remove the header line from VM tracking to free up space
Jouni Malinen [Tue, 17 Dec 2024 22:41:05 +0000 (00:41 +0200)] 
tests: Remove the header line from VM tracking to free up space

This allows one more VM to be tracked (or one more failed test case to
be listed).

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
7 months agotests: Check whether a terminated VM completed the last test case
Jouni Malinen [Tue, 17 Dec 2024 22:19:34 +0000 (00:19 +0200)] 
tests: Check whether a terminated VM completed the last test case

If the VM process (e.g., UML) hangs and gets terminated forcefully,
parallel-vm.py did not report this as a failure. Check whether the last
started test case was completed when a VM terminates and if not, report
it as a test failure.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
7 months agotests: Fix unexpected exit handling
Jouni Malinen [Tue, 17 Dec 2024 22:14:41 +0000 (00:14 +0200)] 
tests: Fix unexpected exit handling

Calculation of remaining VMs seemed to have been messed up in some of
the earlier design changes. Iterate over all VMs instead of check the
terminated VM context data multiple times.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
7 months agotests: Run test cases that read process memory in the beginning
Jouni Malinen [Tue, 17 Dec 2024 18:02:03 +0000 (20:02 +0200)] 
tests: Run test cases that read process memory in the beginning

Those test cases seem to have some resource issues (i.e., taking
unexpectedly large amount of memory) with newer software versions
(showed up when upgrading from Ubuntu 22.04 to 24.04; maybe due to newer
python3 version?). This might be related to memory fragmentation and
allocated memory from hostapd/wpa_supplicant not getting fully freed in
a sense of minimizing the read process memory. Running the key lifetime
test cases in the beginning of each VM seems to avoid resource issues,
so reorder the test cases to do that.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
7 months agotests: Work around compiler differences in forcing failures
Jouni Malinen [Tue, 17 Dec 2024 17:46:43 +0000 (19:46 +0200)] 
tests: Work around compiler differences in forcing failures

Something in the compiler update when moving from Ubuntu 22.04 to 24.04
made these test cases unable to trigger one of the failure sequences.
Modify the failure pattern to avoid this.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
7 months agotests: Fix buffer length prints for process memory reading
Jouni Malinen [Sat, 14 Dec 2024 11:01:24 +0000 (13:01 +0200)] 
tests: Fix buffer length prints for process memory reading

len(buf) does not really work anymore after the previous optimizations.

Fixes: dc766bb57ebe ("tests: Optimize process memory reading using join")
Signed-off-by: Jouni Malinen <j@w1.fi>
7 months agotests: Handle newer tshark version returning boolean values
Jouni Malinen [Sat, 14 Dec 2024 10:34:20 +0000 (12:34 +0200)] 
tests: Handle newer tshark version returning boolean values

Signed-off-by: Jouni Malinen <j@w1.fi>
7 months agotests: EHT checks with newer tshark version
Jouni Malinen [Sat, 14 Dec 2024 10:19:34 +0000 (12:19 +0200)] 
tests: EHT checks with newer tshark version

Support newer tshark versions that are able to dissect the Multi-Link
element.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 months agotests: Get rid of invalid escape sequences
Jouni Malinen [Sat, 14 Dec 2024 08:53:58 +0000 (10:53 +0200)] 
tests: Get rid of invalid escape sequences

These started to show up as SyntaxWarning prints with a newer python3
version and there is really no need to maintain the old versions, so get
rid of the invalid escape sequences.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 months agotests: P2P2 connection without provisioning
Vinay Gannevaram [Thu, 12 Dec 2024 14:43:53 +0000 (20:13 +0530)] 
tests: P2P2 connection without provisioning

Signed-off-by: Vinay Gannevaram <quic_vganneva@quicinc.com>
7 months agoP2P2: Allow P2P2 client to connect to GO with preconfigured credentials
Vinay Gannevaram [Wed, 11 Dec 2024 19:41:43 +0000 (01:11 +0530)] 
P2P2: Allow P2P2 client to connect to GO with preconfigured credentials

A P2P2 GO in PCC mode will allow connecting P2P and P2P2 clients. Such
GO can allow connections with P2P clients by skipping the provisioning
procedure. Add support to allow P2P client to initiate such direct
connection with preconfigured credentials.

Signed-off-by: Vinay Gannevaram <quic_vganneva@quicinc.com>
7 months agoP2P2: Handle join case without pending GO interface address
Vinay Gannevaram [Wed, 11 Dec 2024 19:41:43 +0000 (01:11 +0530)] 
P2P2: Handle join case without pending GO interface address

Fetch a BSS entry using bssid = NULL instead of 00:00:00:00:00:00 when
starting join without a specific GO interface address. This is needed
for P2P2 client joining a group with preconfigured credentials (i.e.,
skipping the provisioning step).

Signed-off-by: Vinay Gannevaram <quic_vganneva@quicinc.com>
7 months agoEHT: Fix HE center frequency for EHT 320 MHz with puncturing
Govindaraj Saminathan [Mon, 9 Dec 2024 05:57:34 +0000 (11:27 +0530)] 
EHT: Fix HE center frequency for EHT 320 MHz with puncturing

Currently, oper_chwidth holds 320 MHz and he_oper_centr_freq_seg0_idx
holds the center frequency of the primary 160 MHz, causing the
calculation of the wrong seg0 from punct_update_legacy_bw() and
leading to connectivity issues with HE STA.

Start with the HE operating bandwidth instead of EHT operating bandwidth
to calculate seg0 to update the correct center frequency in HE Operation
element.

Signed-off-by: Govindaraj Saminathan <quic_gsaminat@quicinc.com>
7 months agonl80211: Update channels unavailability for 320 MHz
Govindaraj Saminathan [Fri, 6 Dec 2024 13:14:04 +0000 (18:44 +0530)] 
nl80211: Update channels unavailability for 320 MHz

Parse NL80211_FREQUENCY_ATTR_NO_320MHZ channel attributes to ensure
correct checking of channel availability in a 320 MHz bandwidth.

Signed-off-by: Govindaraj Saminathan <quic_gsaminat@quicinc.com>
7 months agoAP MLD: Fix radar event processing
Mohan Kumar G [Fri, 6 Dec 2024 06:14:05 +0000 (11:44 +0530)] 
AP MLD: Fix radar event processing

When a radar event is received in an AP MLD operating on a DFS channel,
nl80211_radar_event() iterates over all the BSSs available in drv to
find a link matching the frequency of the event. If a link match is
found, the radar handler function tries to switch to a new channel with
the same bandwidth. In case no valid channels are available it disables
and re-enables the interface, reallocating the drv BSSs. However, the
loop in nl80211_radar_event() function continues to access the old
deallocated BSSs' address in the next iteration, causing a crash.

Since the radar handler function handles the event for all BSSs in an
interface, there is no need to call it again once a link match is found.
Hence, fix this issue by exiting the loop after calling the handler if a
link match is found for the radar event.

Also, since the loop already checks all the BSSs, remove the handler
present before the loop.

Fixes: bfc89d757b72 ("nl80211: Handle radar event properly during MLO")
Signed-off-by: Mohan Kumar G <quic_mkumarg@quicinc.com>
7 months agoEHT: Update legacy bandwidth when puncturing is set in 320 MHz
Govindaraj Saminathan [Fri, 6 Dec 2024 04:31:49 +0000 (10:01 +0530)] 
EHT: Update legacy bandwidth when puncturing is set in 320 MHz

Update lower bandwidth without puncturing for legacy clients when
the puncturing bitmap is set in 320 MHz. This updates the lower
bandwidth in HE and VHT Operation elements when the puncturing
bitmap is set in EHT 320 MHz.

Signed-off-by: Govindaraj Saminathan <quic_gsaminat@quicinc.com>