]> git.ipfire.org Git - thirdparty/hostap.git/log
thirdparty/hostap.git
12 months agoNAN: Fix a typo in USD doc
Chien Wong [Sat, 27 Apr 2024 08:19:43 +0000 (16:19 +0800)] 
NAN: Fix a typo in USD doc

The 'req_instance' parameter in transmit command should be
'req_instance_id'.

Fixes: e3f9ab3c3a01 ("NAN: USD in wpa_supplicant")
Signed-off-by: Chien Wong <m@xv97.com>
12 months agonl80211: AP MLD: Reassign drv->ctx correctly to prevent hostapd crash
Michael-CY Lee [Tue, 14 May 2024 01:20:35 +0000 (09:20 +0800)] 
nl80211: AP MLD: Reassign drv->ctx correctly to prevent hostapd crash

When the first link is deleted and there are still remaining links,
drv->ctx should be updated to the new default link on the bss.
Otherwise, drv->ctx points to the address that has already been freed
and makes hostapd crash.

Fixes: d2b62b3fe500 ("AP MLD: Support link removal before removing interface")
Signed-off-by: Michael-CY Lee <michael-cy.lee@mediatek.com>
12 months agotests: Make SSID verification through beacon protection more robust
Jouni Malinen [Fri, 12 Jul 2024 10:15:57 +0000 (13:15 +0300)] 
tests: Make SSID verification through beacon protection more robust

Clear scan results at the beginning of the test case to avoid incorrect
behavior if there are multiple entries for the same BSS. In addition,
use a bit longer wait for receiving an updated Beacon frame in scan
results.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
12 months agoMake Beacon frame checks less frequent for SSID verification
Jouni Malinen [Fri, 12 Jul 2024 10:13:09 +0000 (13:13 +0300)] 
Make Beacon frame checks less frequent for SSID verification

Instead of checking the latest scan results every second indefinitely,
add more latency between the checks in case the driver does not update
the time stamp value (i.e., does not report new Beacon frames during an
association).

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
12 months agotests: Fix run_eht_mld_sae_two_links()
Ilan Peer [Wed, 1 May 2024 07:19:53 +0000 (10:19 +0300)] 
tests: Fix run_eht_mld_sae_two_links()

In the case that the AP MLD is disabled and enabled again, flush
the wpa_supplicant BSS table before reconnecting as otherwise
the previous AP MLD BSSs would be in the BSS table and the wpa_supplicant
would try to connect to them.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
12 months agowlantest: ICMP: Use sta_find_mlo()
Johannes Berg [Wed, 8 May 2024 20:15:43 +0000 (22:15 +0200)] 
wlantest: ICMP: Use sta_find_mlo()

Using just sta_find() won't work for any link addresses
but the assoc link, use sta_find_mlo() instead.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 months agotests: Use different groups in test_sae_no_ffc_by_default
Andrei Otcheretianski [Wed, 8 May 2024 13:42:13 +0000 (16:42 +0300)] 
tests: Use different groups in test_sae_no_ffc_by_default

The test assumes that STA will try to reconnect with the same SAE group
after the first authentication attempt is rejected due to unsupported
group. Since this behaviour is fixed in the previous patch, configure
two different groups to trigger the second authentication attempt.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
12 months agowpa_supplicant: Do not select a rejected SAE group
Andrei Otcheretianski [Wed, 8 May 2024 13:42:12 +0000 (16:42 +0300)] 
wpa_supplicant: Do not select a rejected SAE group

Make sure that sme_set_sae_group() doesn't select a group that was
previously rejected during this instance of SAE authentication.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
12 months agoAdd int_array_includes()
Andrei Otcheretianski [Wed, 8 May 2024 13:42:12 +0000 (16:42 +0300)] 
Add int_array_includes()

This is a convenient helper function for using int_array instances.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
12 months agowpa_supplicant: Always clear SAE rejected groups on roaming to another BSS
Andrei Otcheretianski [Wed, 8 May 2024 13:42:12 +0000 (16:42 +0300)] 
wpa_supplicant: Always clear SAE rejected groups on roaming to another BSS

SAE rejected groups were not cleared in case of re-association to the
same ESS. Since new BSS can support different groups, keeping rejected
groups doesn't make sense and may result in AP rejecting the
authentication. Fix it.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
12 months agoACS: Fix primary channel puncturing in ACS
Hari Naraayana Desikan Kannan [Tue, 30 Apr 2024 09:52:32 +0000 (15:22 +0530)] 
ACS: Fix primary channel puncturing in ACS

Currently, when the ACS is updating the puncturing bitmap, the function
acs_update_puncturing_bitmap() sets the primary channel bitmap to 0.
This leads to a potential issue where the primary channel could be
punctured if ACS selects a different best channel within the same
segment.

To fix this issue, ensure that the primary channel bitmap is correctly
set by calculating the index of the primary channel based on the
frequency difference between the current channel and the best channel in
the segment, and is then passed to acs_update_puncturing_bitmap().

Fixes: af0f60e7dd00 ("EHT: Calculate puncturing bitmap for ACS")
Signed-off-by: Hari Naraayana Desikan Kannan <quic_hnaraaya@quicinc.com>
12 months agoACS: Fix ACS behavior for channel selection
Hari Naraayana Desikan Kannan [Tue, 30 Apr 2024 09:52:31 +0000 (15:22 +0530)] 
ACS: Fix ACS behavior for channel selection

The current ACS algorithm incorrectly returns success even when there is
no survey list, leading to improper interference factor calculation.
This leads to treating 0 as a valid interference factor, which affects
channel selection judgment.

Fix the issue by ensuring success is only returned when the survey list
is not empty, thereby ignoring non-zero values in the interference
factor calculation.

Signed-off-by: Hari Naraayana Desikan Kannan <quic_hnaraaya@quicinc.com>
12 months agoACS: Update ACS documentation
Hari Naraayana Desikan Kannan [Tue, 30 Apr 2024 09:52:30 +0000 (15:22 +0530)] 
ACS: Update ACS documentation

Update the documentation to reflect the ACS algorithm used in the code.
No functionality change.

Signed-off-by: Hari Naraayana Desikan Kannan <quic_hnaraaya@quicinc.com>
12 months agoMLO: Swap Tx/Rx keys for GTK TKIP Michael MIC in MLO GTK KDE
Hu Wang [Tue, 9 Jul 2024 07:55:28 +0000 (00:55 -0700)] 
MLO: Swap Tx/Rx keys for GTK TKIP Michael MIC in MLO GTK KDE

While TKIP should not really be used at all anymore and is not allowed
for WPA3 (which is required for Wi-Fi 7), there are some deployed APs
that allow WPA2 PSK to be used with MLO and even allowing WPA+WPA2 mode
with TKIP as the group cipher). IEEE P802.11be/D5.0 does not seem to
explicitly disallow this combination, so handle the MLO GTK KDE key
processing similarly to the way GTK KDE is processed, i.e., including
swapping of Michael MIC Tx and Rx keys for TKIP.

This fixes issues with Michael MIC failures if TKIP is used as a group
cipher for a multi-link association.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
12 months agoFix channel switch without 'ht' for HE and EHT modes in 2.4 GHz band
Pradeep Kumar Chitrapu [Wed, 8 May 2024 18:04:05 +0000 (11:04 -0700)] 
Fix channel switch without 'ht' for HE and EHT modes in 2.4 GHz band

hostapd_cli chan_switch command fails in 2.4 GHz band for HE and EHT
modes if the user does not explicitly specify 'ht' option in the
command.

For example:
"hostapd_cli -i wlan2 chan_switch 10 2412 sec_channel_offset=0 \
 center_freq1=2412 bandwidth=20 blocktx he"

Fix this by enabling HT by default if HE is enabled in the 2.4 GHz and 5
GHz bands. Similarly, enable VHT by default when HE is enabled in the 5
GHz band.

Signed-off-by: Pradeep Kumar Chitrapu <quic_pradeepc@quicinc.com>
12 months agoFix mesh 6 GHz incorrect channel bandwidth
Harshitha Prem [Fri, 12 Jul 2024 07:34:21 +0000 (13:04 +0530)] 
Fix mesh 6 GHz incorrect channel bandwidth

When the wiphy supports multiple bands and reports different capability
values between 5 GHz and 6 GHz channels, the 6 GHz mesh interface is
unable to correctly map the channel width in function
ibss_mesh_setup_freq(). This issue arises because the modes of 5 GHz and
6 GHz interfaces are the same (HOSTAPD_MODE_IEEE80211A) in supported
modes.

To address this, use function get_mode() to determine the appropriate
mode during mesh setup. This will iterates through all the hw_features
sets and ensures compatibility with the band of the channel supported in
hw_features set.

Signed-off-by: Harshitha Prem <quic_hprem@quicinc.com>
12 months agotests: SSID verification using beacon protection
Jouni Malinen [Thu, 11 Jul 2024 20:55:14 +0000 (23:55 +0300)] 
tests: SSID verification using beacon protection

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
12 months agoSSID verification based on beacon protection
Jouni Malinen [Thu, 11 Jul 2024 20:52:30 +0000 (23:52 +0300)] 
SSID verification based on beacon protection

If SSID was not verified during the initial setup of an association, but
beacon protection was negotiated, try verify the SSID based on Beacon
frames that have been received after the first BIGTK has been
configured.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
12 months agoBSS: Add wpa_bss_get_ie_beacon()
Jouni Malinen [Thu, 11 Jul 2024 20:50:55 +0000 (23:50 +0300)] 
BSS: Add wpa_bss_get_ie_beacon()

This is a variant of wpa_bss_get_ie() to allow IEs to be checked from
only Beacon frames similarly to how wpa_bss_get_vendor_ie_beacon()
behaves for vendor specific elements.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
12 months agotests: Verify bigtk_set=1 indication
Jouni Malinen [Thu, 11 Jul 2024 20:16:05 +0000 (23:16 +0300)] 
tests: Verify bigtk_set=1 indication

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
12 months agoIndicate if BIGTK has been set in STATUS output
Jouni Malinen [Thu, 11 Jul 2024 20:14:02 +0000 (23:14 +0300)] 
Indicate if BIGTK has been set in STATUS output

The new "bigtk_set=1" entry in the control interface STATUS command
output indicates that a BIGTK has been successfully configured. This
shows that beacon protection has been enabled for the current
association.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
12 months agotests: Verify that ssid_verified=1 is set appropriately
Jouni Malinen [Thu, 11 Jul 2024 19:46:59 +0000 (22:46 +0300)] 
tests: Verify that ssid_verified=1 is set appropriately

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
12 months agoIndicate if SSID has been verified in STATUS output
Jouni Malinen [Thu, 11 Jul 2024 19:44:46 +0000 (22:44 +0300)] 
Indicate if SSID has been verified in STATUS output

Add a new "ssid_verified=1" entry into the control interface STATUS
command output if the SSID has been verified for the current
association. This verification may have been done implicitly (e.g., with
SAE H2E and FT protocol binding in the SSID into key derivation or with
FILS protecting the SSID element in the (Re)Association Request frame)
or explicitly with the recently added SSID protection mechanism during
the 4-way handshake.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
12 months agoPASN: Derive KDK on AP only when both ends support SecureLTF
Sai Pratyusha Magam [Thu, 9 May 2024 09:46:29 +0000 (15:16 +0530)] 
PASN: Derive KDK on AP only when both ends support SecureLTF

On the AP responder side, KDK was derived if the driver advertises
WPA_DRIVER_FLAGS2_SEC_LTF_AP. That is not correct, i.e., this needs to
also depend on the initiator indicating support for this in the RSNXE of
PASN authentication frame 1.

Signed-off-by: Sai Pratyusha Magam <quic_smagam@quicinc.com>
12 months agodbus: Fix error path in scan request handling
Ilan Peer [Sun, 30 Jun 2024 16:39:46 +0000 (19:39 +0300)] 
dbus: Fix error path in scan request handling

In case the scan request handling fails, exit cleanly, i.e., without
setting internal state such as the 'scan_res_handler' pointer.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
12 months agotests: Ignore large memory blocks when searching for keys
Benjamin Berg [Fri, 14 Jun 2024 08:13:51 +0000 (10:13 +0200)] 
tests: Ignore large memory blocks when searching for keys

wpa_supplicant will generally never allocate a memory block of that
size. We can therefore assume that it belongs to ASAN and we need to
ignore it.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
12 months agotrace: Only permit explicit prefix matching for functions
Benjamin Berg [Fri, 14 Jun 2024 08:13:50 +0000 (10:13 +0200)] 
trace: Only permit explicit prefix matching for functions

The matching code currently only tests whether the prefix of a function
matches. Make this more strict by ensuring that the function name is not
longer.

However, as this breaks some tests (due to inlining), add the ability to
do an explicit prefix match by appending a '*' to the function name. Use
this to change the eap_eke_prf match to eap_eke_prf_* in order to match
one of the actual implementations.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
12 months agotrace: Use strncmp() to match function names
Benjamin Berg [Fri, 14 Jun 2024 08:13:49 +0000 (10:13 +0200)] 
trace: Use strncmp() to match function names

The functions specified by the user might be longer than the function in
the backtrace, potentially overflowing the memcmp(). In practice, it
should not be a relevant out-of-memory read. However, we can use
strncmp() instead.

Note that, as before, this is only a prefix match. If a function name is
longer in the backtrace it will still match.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
12 months agotests: Use sha256_prf_bits for failure stack matching
Benjamin Berg [Fri, 14 Jun 2024 08:13:48 +0000 (10:13 +0200)] 
tests: Use sha256_prf_bits for failure stack matching

It seems that sha256_prf may not always be in the stack trace for
failure checking, possibly due to tail call optimization as it simply
calls sha256_prf_bits with updated parameters. Simply match against
sha256_prf_bits directly to avoid issues due to optimizations.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
12 months agotests: Remove duplicate fail test check
Benjamin Berg [Fri, 14 Jun 2024 08:13:47 +0000 (10:13 +0200)] 
tests: Remove duplicate fail test check

The wpas_p2p_nfc_handover failure test and the more specific
wps_build_nfc_handover_req_p2p were effectively the same as the matching
currently does a prefix match. The code-path tested in these two cases
only hit a single TEST_FAIL macro in openssl_digest_vector.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
12 months agotests: Use more specific alloc_fail location
Benjamin Berg [Fri, 14 Jun 2024 08:13:46 +0000 (10:13 +0200)] 
tests: Use more specific alloc_fail location

The test here is triggering the allocation failure in the static
wpa_config_parse_password() helper. Use this and decrease the count
instead of matching both wpa_config_set_quoted() and wpa_config_set()
and counting down based on that.

This is in preparation to fix the failure function matching to not do a
prefix match.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
12 months agotests: Specify correct function name for failure
Benjamin Berg [Fri, 14 Jun 2024 08:13:45 +0000 (10:13 +0200)] 
tests: Specify correct function name for failure

The test expects rsn_pmkid_suite_b_192() to fail but specified only
rsn_pmkid_suite_b without the _192 postfix. Add the postfix so that the
function matching can be fixed later.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
12 months agoPMKSA: Guard against NULL KCK for memcpy()
Benjamin Berg [Fri, 14 Jun 2024 08:13:44 +0000 (10:13 +0200)] 
PMKSA: Guard against NULL KCK for memcpy()

If the kck_len is 0 then the pointer may be NULL. If that happens UBSAN
complains about the NULL pointer as memcpy() has the arguments declared
to never be NULL even if the copied number of bytes were zero.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
12 months agoMLD: Ensure link_bssid array has space for sentinel
Benjamin Berg [Fri, 14 Jun 2024 08:13:43 +0000 (10:13 +0200)] 
MLD: Ensure link_bssid array has space for sentinel

The consumer of the link_bssid array assumes it is a NULL terminated
array of BSSIDs. As such, add one to the maximum number of links to
ensure that there is always a sentinel value.

Fixes: 5af986c75af4 ("MLD: Also mark links as failed after association failure")
Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
12 months agoMLD: Ensure link BSSIDs remain on stack for ignore
Benjamin Berg [Fri, 14 Jun 2024 08:13:42 +0000 (10:13 +0200)] 
MLD: Ensure link BSSIDs remain on stack for ignore

When ignoring a link BSSID the multi-link information was parsed out
into a struct ml_sta_link_info on the stack. However, this stack
variable went out of scope before it was used by passing the link_bssids
pointer array to another function.

Fixes: 5af986c75af4 ("MLD: Also mark links as failed after association failure")
Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
12 months agodbus: Make sure ServiceDiscoveryRequest/Result does not override pointers
Jouni Malinen [Thu, 11 Jul 2024 15:35:28 +0000 (18:35 +0300)] 
dbus: Make sure ServiceDiscoveryRequest/Result does not override pointers

Explicitly free the previously allocated copy if ServiceDiscoveryRequest
or Service DiscvoveryResponse parsing loop finds multiple instances of
the same dict entry.

Signed-off-by: Jouni Malinen <j@w1.fi>
12 months agodbus: Fix memory leak in case dbus provides 'tlvs' in invalid P2P SD response
Davide Caratti [Thu, 30 May 2024 08:46:33 +0000 (10:46 +0200)] 
dbus: Fix memory leak in case dbus provides 'tlvs' in invalid P2P SD response

Using D-Bus it is possible to request an invalid SD response where
"tlvs" is specified and there is an unknown key (e.g. "bar": "foo"). In
this case, "tlv" is allocated and then never used nor freed. Valgrind
complains as follows:

 36 bytes in 1 blocks are definitely lost in loss record 20 of 74
    at 0x484C214: calloc (vg_replace_malloc.c:1675)
    by 0x41C673: wpabuf_alloc (wpabuf.c:124)
    by 0x41C673: wpabuf_alloc_copy (wpabuf.c:162)
    by 0x54FB94: wpas_dbus_handler_p2p_service_sd_res (dbus_new_handlers_p2p.c:3016)
    by 0x53B9A2: msg_method_handler (dbus_new_helpers.c:356)
    by 0x53B9A2: message_handler (dbus_new_helpers.c:412)
    by 0x4EAB4B8: dbus_connection_dispatch (in /usr/lib64/libdbus-1.so.3.19.13)
    by 0x5495DF: dispatch_data (dbus_common.c:37)
    by 0x5495DF: process_watch (dbus_common.c:73)
    by 0x5495DF: process_watch_read (dbus_common.c:89)
    by 0x41EE8E: eloop_sock_table_dispatch.part.0 (eloop.c:603)
    by 0x41FA46: eloop_sock_table_dispatch (eloop.c:597)
    by 0x41FA46: eloop_run (eloop.c:1233)
    by 0x56A3EE: wpa_supplicant_run (wpa_supplicant.c:8074)
    by 0x40DB06: main (main.c:393)

Fix it ensuring that "tlv" is freed both in the error and non-error path
of wpas_dbus_handler_p2p_service_sd_res(). Also, add a test case in
test_dbus.py to verify correct behavior.

Signed-off-by: Davide Caratti <davide.caratti@gmail.com>
12 months agodbus: Fix memory leak in case dbus provides tlv in P2P UPnP SD request
Davide Caratti [Thu, 30 May 2024 08:46:32 +0000 (10:46 +0200)] 
dbus: Fix memory leak in case dbus provides tlv in P2P UPnP SD request

Using D-Bus it is possible to trigger a valid UPnP SD request where
"tlv" is specified: in this case "tlv" is allocated, and then not used
nor freed. Valgrind complains as follows:

 72 bytes in 2 blocks are definitely lost in loss record 46 of 68
    at 0x484C214: calloc (vg_replace_malloc.c:1675)
    by 0x41C673: wpabuf_alloc (wpabuf.c:124)
    by 0x41C673: wpabuf_alloc_copy (wpabuf.c:162)
    by 0x54F8B5: wpas_dbus_handler_p2p_service_sd_req (dbus_new_handlers_p2p.c:2928)
    by 0x53B9A2: msg_method_handler (dbus_new_helpers.c:356)
    by 0x53B9A2: message_handler (dbus_new_helpers.c:412)
    by 0x4EAB4B8: dbus_connection_dispatch (in /usr/lib64/libdbus-1.so.3.19.13)
    by 0x5495DF: dispatch_data (dbus_common.c:37)
    by 0x5495DF: process_watch (dbus_common.c:73)
    by 0x5495DF: process_watch_read (dbus_common.c:89)
    by 0x41EE8E: eloop_sock_table_dispatch.part.0 (eloop.c:603)
    by 0x41FA46: eloop_sock_table_dispatch (eloop.c:597)
    by 0x41FA46: eloop_run (eloop.c:1233)
    by 0x56A3CE: wpa_supplicant_run (wpa_supplicant.c:8074)
    by 0x40DB06: main (main.c:393)

Fix it ensuring that "tlv" is freed, both in the error and non-error
path of wpas_dbus_handler_p2p_service_sd_req(). Also, add a test case in
test_dbus.py to verify correct behavior.

Signed-off-by: Davide Caratti <davide.caratti@gmail.com>
12 months agonl80211: Use actual number of supported AKMs for AP setup
Sascha Hauer [Thu, 30 May 2024 12:31:05 +0000 (14:31 +0200)] 
nl80211: Use actual number of supported AKMs for AP setup

Since 0ce1545dcb8 ("nl80211: Determine maximum number of supported
AKMs") we get the maximum number of supported AKMs from the kernel.
Let's use that instead of the legacy NL80211_MAX_NR_AKM_SUITES when
setting up AP mode operation.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
12 months agoSecureLTF: Work around misbehaving STAs for PTK derivation without KDK
Sai Pratyusha Magam [Sun, 2 Jun 2024 15:20:38 +0000 (20:50 +0530)] 
SecureLTF: Work around misbehaving STAs for PTK derivation without KDK

Some deployed STAs that advertise SecureLTF support in the RSNXE in
(Re)Association Request frames, do not derive KDK during PTK generation.
Since the correct key calculations in the AP includes an additional KDK
generation in such cases, this causes different PTK-KCK being derived
and the AP ultimately discarding EAPOL-Key message 2/4 due to MIC
validation failure.

Try to derive a PTK without KDK as a workaround in such cases and allow
the 4-way handshake to continue if this results in a matching MIC.

Signed-off-by: Sai Pratyusha Magam <quic_smagam@quicinc.com>
12 months agoDo not derive SAE PT if the network profile does not include SAE
Hu Wang [Wed, 5 Jun 2024 05:21:02 +0000 (22:21 -0700)] 
Do not derive SAE PT if the network profile does not include SAE

wpa_s_setup_sae_pt() derived SAE PT even when the configured key
management options did not include SAE if the global sae_pwe
configuration parameter had been changed to enable H2E. This adds
unnecessary extra delay, so derive PT only if SAE is actually enabled in
the network profile.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
12 months agotests: Extend color change test for a non-first link of an AP MLD
Aditya Kumar Singh [Wed, 12 Jun 2024 14:27:54 +0000 (19:57 +0530)] 
tests: Extend color change test for a non-first link of an AP MLD

Currently color change test is supported only on the first link of the
AP MLD. Extend the support to test on non-first link as well.

Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
12 months agonl80211: AP MLD: Parse link ID to determine the BSS for color event
Aditya Kumar Singh [Wed, 12 Jun 2024 14:27:53 +0000 (19:57 +0530)] 
nl80211: AP MLD: Parse link ID to determine the BSS for color event

When an HE BSS color event is received from the driver, the event was
delevered to the first link BSS ctx. To support HE BSS color with MLO,
there is a need to identify the correct link for which the event is
intended.

Add link ID parsing support in the event handler and pass the link ID
(if included) down to the event handler so that appropriate link can be
selected.

Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
12 months agonl80211: Refactor color collision related nl80211 commands handling
Aditya Kumar Singh [Wed, 12 Jun 2024 14:27:52 +0000 (19:57 +0530)] 
nl80211: Refactor color collision related nl80211 commands handling

Almost same logic is there in handling four different commands related
to color collision. Later when link ID needs to be parsed, it would be
more duplicate logic at four different places. Hence refactor and bring
it in a single function.

No functionality changes.

Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
12 months agohostapd: Fix updating Beacon frames during association handling
Aditya Kumar Singh [Thu, 11 Jul 2024 09:05:39 +0000 (14:35 +0530)] 
hostapd: Fix updating Beacon frames during association handling

In function handle_assoc(), ieee802_11_update_beacons() was used to
update the Beacon frames. However, with commit a5d0bb42a226 ("Reduce
delay between Association Request and Association Response"), it was
changed to ieee802_11_set_beacons() which basically overturned what
commit e59d2a31cfb4 ("hostapd: Fix premature beacon set during
association handling") did which is not correct.

Fix this and use ieee802_11_update_beacons() instead of
ieee802_11_set_beacons().

Fixes: a5d0bb42a226 ("Reduce delay between Association Request and Association Response")
Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
12 months agoSAE: Reject invalid Rejected Groups element in the parser
Jouni Malinen [Tue, 9 Jul 2024 20:34:34 +0000 (23:34 +0300)] 
SAE: Reject invalid Rejected Groups element in the parser

There is no need to depend on all uses (i.e., both hostapd and
wpa_supplicant) to verify that the length of the Rejected Groups field
in the Rejected Groups element is valid (i.e., a multiple of two octets)
since the common parser can reject the message when detecting this.

Signed-off-by: Jouni Malinen <j@w1.fi>
12 months agoSAE: Check for invalid Rejected Groups element length explicitly on STA
Jouni Malinen [Tue, 9 Jul 2024 20:33:38 +0000 (23:33 +0300)] 
SAE: Check for invalid Rejected Groups element length explicitly on STA

Instead of practically ignoring an odd octet at the end of the element,
check for such invalid case explicitly. This is needed to avoid a
potential group downgrade attack.

Fixes: 444d76f74f65 ("SAE: Check that peer's rejected groups are not enabled")
Signed-off-by: Jouni Malinen <j@w1.fi>
12 months agonl80211: Send link ID with NL80211_CMD_TDLS_MGMT to enable TDLS with MLO
Aleti Nageshwar Reddy [Wed, 3 Jul 2024 10:34:45 +0000 (16:04 +0530)] 
nl80211: Send link ID with NL80211_CMD_TDLS_MGMT to enable TDLS with MLO

The latest Linux kernel is mandating link ID with NL80211_CMD_TDLS_MGMT
for MLO connections. This resulted in not being able to perform TDLS
operations during a multi-link association.

Fix this by sending link ID in NL80211_CMD_TDLS_MGMT when available. If
link ID info is not available, send the link ID of the association link.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
12 months agoRADIUS: Check Message-Authenticator if it is present even if not required
Jouni Malinen [Sun, 17 Mar 2024 08:47:58 +0000 (10:47 +0200)] 
RADIUS: Check Message-Authenticator if it is present even if not required

Always check the Message-Authenticator attribute in a received RADIUS
message if it is present. Previously, this would have been skipped if
the attribute was not required to be present.

Signed-off-by: Jouni Malinen <j@w1.fi>
12 months agoRADIUS: Require Message-Authenticator attribute in MAC ACL cases
Jouni Malinen [Sun, 17 Mar 2024 08:42:56 +0000 (10:42 +0200)] 
RADIUS: Require Message-Authenticator attribute in MAC ACL cases

hostapd required Message-Authenticator attribute to be included in EAP
authentication cases, but that requirement was not in place for MAC ACL
cases. Start requiring Message-Authenticator attribute for MAC ACL by
default. Unlike the EAP case, this can still be disabled with
radius_require_message_authenticator=1 to maintain compatibility with
some RADIUS servers when used in a network where the connection to such
a server is secure.

Signed-off-by: Jouni Malinen <j@w1.fi>
12 months agoRequire Message-Authenticator in Access-Reject even without EAP-Message
Jouni Malinen [Sat, 16 Mar 2024 09:31:37 +0000 (11:31 +0200)] 
Require Message-Authenticator in Access-Reject even without EAP-Message

Do not allow the exception for missing Message-Authenticator in
Access-Reject without EAP-Message. While such exception is allowed in
RADIUS definition, there is no strong reason to maintain this since
Access-Reject is supposed to include EAP-Message and even if it doesn't,
discarding Access-Reject will result in the connection not completing.

Signed-off-by: Jouni Malinen <j@w1.fi>
12 months agoRADIUS DAS: Move Message-Authenticator attribute to be the first one
Jouni Malinen [Sat, 16 Mar 2024 09:26:58 +0000 (11:26 +0200)] 
RADIUS DAS: Move Message-Authenticator attribute to be the first one

Even if this might not be strictly speaking necessary for mitigating
certain RADIUS protocol attacks, be consistent with the RADIUS server
behavior and move the Message-Authenticator attribute to be the first
attribute in the RADIUS DAS responses from hostapd.

Signed-off-by: Jouni Malinen <j@w1.fi>
12 months agohostapd: Move Message-Authenticator attribute to be the first one in req
Jouni Malinen [Sat, 16 Mar 2024 09:22:43 +0000 (11:22 +0200)] 
hostapd: Move Message-Authenticator attribute to be the first one in req

Even if this is not strictly speaking necessary for mitigating certain
RADIUS protocol attacks, be consistent with the RADIUS server behavior
and move the Message-Authenticator attribute to be the first attribute
in the message from RADIUS client in hostapd.

Signed-off-by: Jouni Malinen <j@w1.fi>
12 months agoeapol_test: Move Message-Authenticator attribute to be the first one
Jouni Malinen [Sat, 16 Mar 2024 09:16:12 +0000 (11:16 +0200)] 
eapol_test: Move Message-Authenticator attribute to be the first one

Even if this is not strictly speaking necessary for mitigating certain
RADIUS protocol attacks, be consistent with the RADIUS server behavior
and move the Message-Authenticator attribute to be the first attribute
in the message from RADIUS client.

Signed-off-by: Jouni Malinen <j@w1.fi>
12 months agoRADIUS server: Place Message-Authenticator attribute as the first one
Jouni Malinen [Sat, 16 Mar 2024 09:13:32 +0000 (11:13 +0200)] 
RADIUS server: Place Message-Authenticator attribute as the first one

Move the Message-Authenticator attribute to be the first attribute in
the RADIUS messages. This mitigates certain MD5 attacks against
RADIUS/UDP.

Signed-off-by: Jouni Malinen <j@w1.fi>
12 months agoRADIUS: Allow Message-Authenticator attribute as the first attribute
Jouni Malinen [Sat, 16 Mar 2024 09:11:44 +0000 (11:11 +0200)] 
RADIUS: Allow Message-Authenticator attribute as the first attribute

If a Message-Authenticator attribute was already added to a RADIUS
message, use that attribute instead of adding a new one when finishing
message building. This allows the Message-Authenticator attribute to be
placed as the first attribute in the message.

Signed-off-by: Jouni Malinen <j@w1.fi>
12 months agotests: Include Message-Authenticator attribute in RADIUS tests
Jouni Malinen [Sun, 17 Mar 2024 09:10:16 +0000 (11:10 +0200)] 
tests: Include Message-Authenticator attribute in RADIUS tests

This is in preparation for hostapd requiring this attribute for all
cases.

Signed-off-by: Jouni Malinen <j@w1.fi>
12 months agotests: SAE H2E and rejected groups with different APs and different config
Jouni Malinen [Sun, 7 Jul 2024 09:14:11 +0000 (12:14 +0300)] 
tests: SAE H2E and rejected groups with different APs and different config

Signed-off-by: Jouni Malinen <j@w1.fi>
12 months agoSAE: Clear rejected groups list on completing authentication
Jouni Malinen [Sun, 7 Jul 2024 09:11:06 +0000 (12:11 +0300)] 
SAE: Clear rejected groups list on completing authentication

The rejected groups list is valid only during each individual SAE
authentication instance and it should not be maintained between separate
instances. In particular, it should not be maintained when roaming to
another AP since the APs might use different configuration for the
allowed SAE groups.

Signed-off-by: Jouni Malinen <j@w1.fi>
12 months agotests: SAE protocol testing - Invalid Rejected Groups element
Jouni Malinen [Sun, 7 Jul 2024 08:59:16 +0000 (11:59 +0300)] 
tests: SAE protocol testing - Invalid Rejected Groups element

Signed-off-by: Jouni Malinen <j@w1.fi>
12 months agoSAE: Clear rejected groups list on continuous failures
Jouni Malinen [Sun, 7 Jul 2024 08:52:36 +0000 (11:52 +0300)] 
SAE: Clear rejected groups list on continuous failures

wpa_supplicant used to maintain the list of rejected groups for SAE over
multiple failed attempts. This could have some DoS issues, so clear this
list if SAE authentication attempts fails continuously.

Signed-off-by: Jouni Malinen <j@w1.fi>
12 months agoSAE: Clear peer_rejected_groups when no element is included
Jouni Malinen [Sun, 7 Jul 2024 08:48:35 +0000 (11:48 +0300)] 
SAE: Clear peer_rejected_groups when no element is included

When parsing a SAE Commit message, the temporary peer_rejected_groups
parameter was left to its old value in cases where the new SAE Commit
message did not include the Rejected Groups element. This could result
in unexpected behavior if a previously processed SAE Commit message
included a Rejected Groups element that claimed one of the enabled
groups to be rejected.

Explicitly clear the peer_rejected_groups value when parsing an SAE
Commit message without a Rejected Groups element to avoid rejecting the
new message based on some previously received incorrect information.
This avoids some potential denial-of-service issues during the lifetime
of the SAE temporary data.

Signed-off-by: Jouni Malinen <j@w1.fi>
12 months agoSAE: Check for invalid Rejected Groups element length explicitly
Jouni Malinen [Sun, 7 Jul 2024 08:46:49 +0000 (11:46 +0300)] 
SAE: Check for invalid Rejected Groups element length explicitly

Instead of practically ignoring an odd octet at the end of the element,
check for such invalid case explicitly. This is needed to avoid a
potential group downgrade attack.

Signed-off-by: Jouni Malinen <j@w1.fi>
13 months agoVendor attribute to configure STA to follow AP preference for candidates
Gururaj Pandurangi [Tue, 18 Jun 2024 01:18:01 +0000 (18:18 -0700)] 
Vendor attribute to configure STA to follow AP preference for candidates

Add a vendor attribute to configure a STA to follow AP advertised
preference values to select roam candidates with BTM.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
13 months agoVendor command extension for Responder PM Mode bit in TWT SET Request
Purushottam Kushwaha [Fri, 7 Jun 2024 11:10:16 +0000 (16:40 +0530)] 
Vendor command extension for Responder PM Mode bit in TWT SET Request

Use the existing QCA_WLAN_VENDOR_ATTR_TWT_SETUP_RESPONDER_PM_MODE
attribute for TWT setup request to configure the Responder PM Mode bit
in the control field of the TWT element or broadcast TWT schedule.

Signed-off-by: Purushottam Kushwaha <quic_pkushwah@quicinc.com>
13 months agoAdd vendor flag to indicate unavailability mode in TWT responder mode
Purushottam Kushwaha [Fri, 7 Jun 2024 11:18:29 +0000 (16:48 +0530)] 
Add vendor flag to indicate unavailability mode in TWT responder mode

Add a flag attribute
QCA_WLAN_VENDOR_ATTR_TWT_SET_PARAM_UNAVAILABILITY_MODE into enum
qca_wlan_vendor_attr_twt_set_param to configure the TWT responder
unavailability outside of the SPs of its broadcast TWT schedule.

Signed-off-by: Purushottam Kushwaha <quic_pkushwah@quicinc.com>
13 months agotests: SAE protocol testing and a valid commit after a failed one
Jouni Malinen [Thu, 20 Jun 2024 15:24:10 +0000 (18:24 +0300)] 
tests: SAE protocol testing and a valid commit after a failed one

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
13 months agoSAE: Free password identifier if SAE commit is rejected due to it
Chenming Huang [Fri, 31 May 2024 02:28:36 +0000 (07:58 +0530)] 
SAE: Free password identifier if SAE commit is rejected due to it

Authentication rejection was found when doing fuzz testing even with a
valid SAE commit message when it was sent after a SAE commit message
that included an incorrect password identifier. The test steps for this
are as below:

1. Peer sends an abnormal commit message with incorrect password
   identifier
2. APUT rejects as expected
3. Peer sends a valid commit message
4. APUT rejects again, which is not expected

In step 2, as the abnormal data fakes an empty password identifier
element, it passes sae_is_password_id_elem() checking. Memory is then
allocated for sae->tmp->pw_id. The authentication process then fails
due to no available password with this invalid password identifier.

In step 4, though the peer sends a valid commit message, APUT rejects
this SAE commit again due to no password identifier element (due to that
sae->tmp->pw_id being set), which is not expected.

Free the sae->tmp->pw_id field and set it to NULL when SAE commit
message processing fails due to an unknown password identifier so that
the bogus value is not used as a requirement for any consecutive SAE
commit from the same STA before the STA entry gets cleared.

Signed-off-by: Chenming Huang <quic_chenhuan@quicinc.com>
13 months agoDefine Link Id attribute for secure ranging context vendor command
Nidhi Jain [Thu, 6 Jun 2024 05:10:42 +0000 (10:40 +0530)] 
Define Link Id attribute for secure ranging context vendor command

The Link Id attribute is required for secure ranging context to identify
the link on which the command is received for an MLD.

Signed-off-by: Nidhi Jain <quic_nidhjain@quicinc.com>
13 months agoDefine Link Id attribute for QCA_NL80211_VENDOR_SUBCMD_PASN
Nidhi Jain [Thu, 6 Jun 2024 06:47:05 +0000 (12:17 +0530)] 
Define Link Id attribute for QCA_NL80211_VENDOR_SUBCMD_PASN

The Link Id attribute is required for QCA_NL80211_VENDOR_SUBCMD_PASN to
identify the link on which the command is received for an MLD.

Signed-off-by: Nidhi Jain <quic_nidhjain@quicinc.com>
13 months agoAdd Link ID for External ACS vendor command
Diya Sati [Tue, 11 Jun 2024 06:46:03 +0000 (12:16 +0530)] 
Add Link ID for External ACS vendor command

The Link Id attribute is required for external ACS context to identify
the link on which the command is received for an AP MLD.

Signed-off-by: Diya Sati <quic_dsati@quicinc.com>
13 months agotests: SAE with SSID protection in 4-way handshake
Jouni Malinen [Tue, 18 Jun 2024 22:11:40 +0000 (01:11 +0300)] 
tests: SAE with SSID protection in 4-way handshake

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
13 months agoSSID protection in 4-way handshake on AP
Jouni Malinen [Tue, 18 Jun 2024 22:09:52 +0000 (01:09 +0300)] 
SSID protection in 4-way handshake on AP

Add support for SSID protection in 4-way handshake based on the
mechanism added in IEEE 802.11REVme/D6.0. This is a mitigation against
CVE-2023-52424 (a.k.a. the SSID Confusion Attack).

This functionality is disabled by default and can be enabled with
ssid_protection=1. Once there has been more testing of this to confirm
there is no significant interoperability issues, the goal is to be able
to change this to be enabled by default.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
13 months agoSSID protection in 4-way handshake on STA
Jouni Malinen [Tue, 18 Jun 2024 22:07:36 +0000 (01:07 +0300)] 
SSID protection in 4-way handshake on STA

Add support for SSID protection in 4-way handshake based on the
mechanism added in IEEE 802.11REVme/D6.0. This is a mitigation against
CVE-2023-52424 (a.k.a. the SSID Confusion Attack).

This functionality is disabled by default and can be enabled with
ssid_protection=1 in the network profile. Once there has been more
testing of this to confirm there is no significant interoperability
issues, the goal is to be able to change this to be enabled by default.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
13 months agoSTA: Update scan results when BSS entry with current SSID is not found
Veerendranath Jakkam [Mon, 15 Apr 2024 20:00:43 +0000 (01:30 +0530)] 
STA: Update scan results when BSS entry with current SSID is not found

wpa_supplicant might use a wrong BSS entry with the SSID different from
the current SSID of the current BSS while processing a roam event from
the driver when wpa_supplicant has a stale BSS entry with the old SSID
and the driver roams to the same BSS after it is restarted with a new
SSID.

To avoid this, update scan results from the driver when a BSS entry is
not found with the current SSID and try to fetch the BSS entry again
with the current SSID after this.

Also, with this change wpa_supplicant_get_new_bss() itself will update
the BSS table and search for the current BSS entry if it is not found in
the BSS table. So, remove the BSS table update and search logic from the
callers of wpa_supplicant_get_new_bss().

Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
13 months agotests: Add color change test for an AP MLD
Aditya Kumar Singh [Mon, 22 Apr 2024 12:40:05 +0000 (18:10 +0530)] 
tests: Add color change test for an AP MLD

Add the eht_mlo_color_change test case to perform color change on the
first link of an AP MLD. Performing on non-first link will be done
later.

Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
13 months agotests: Add HE BSS color change test
Aditya Kumar Singh [Mon, 22 Apr 2024 12:40:04 +0000 (18:10 +0530)] 
tests: Add HE BSS color change test

Add the he_bss_color_change test case which brings up an HE AP and
performs color change operations and validates the result.

Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
13 months agoAP MLD: Send link id to the driver during color change
Aditya Kumar Singh [Mon, 22 Apr 2024 12:40:03 +0000 (18:10 +0530)] 
AP MLD: Send link id to the driver during color change

Send the link ID in the nl80211 command to switch color if the AP is
affiliated with an AP MLD.

Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
13 months agoUpdate Beacon frames after color change
Aditya Kumar Singh [Mon, 22 Apr 2024 12:40:02 +0000 (18:10 +0530)] 
Update Beacon frames after color change

Once CCA is finished, Beacon frames need to be updated. The BCCA element
needs to be removed and the new color value shall be advertised in the
BSS Color Information field of the HE Operation element.

Update the Beacon frames accordingly.

Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
13 months agoRemove double "on" from debug prints in CCA event callbacks
Aditya Kumar Singh [Mon, 22 Apr 2024 12:40:01 +0000 (18:10 +0530)] 
Remove double "on" from debug prints in CCA event callbacks

Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
13 months agohostapd: Add support to change BSS color from the control interface
Aditya Kumar Singh [Mon, 22 Apr 2024 12:40:00 +0000 (18:10 +0530)] 
hostapd: Add support to change BSS color from the control interface

Add hostapd_cli command "color_change <color>" to change BSS color at
run time. hostapd_cli status can be used to check the updated color.

Usage: hostapd_cli -i <interface> color_change <color>

If 0 value is given, HE BSS color would be disabled. Same or a non-zero
value between [1-63] can be given to enable color again.

Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
13 months agoACS: Handle scan start request failure with error code -EBUSY
Harshitha Prem [Mon, 22 Apr 2024 11:19:06 +0000 (16:49 +0530)] 
ACS: Handle scan start request failure with error code -EBUSY

Currently, if ACS scan request fails, states are cleared and returned.
However, in case of MLO, there is a possibilty of getting return value
of -EBUSY. In this case, ACS can retry the scan request after some time
similary to the HT40 scan.

Hence, retry the scan after 5 seconds if -EBUSY is returned. Maximum of
15 re-attempts are made before giving up.

Signed-off-by: Harshitha Prem <quic_hprem@quicinc.com>
Co-developed-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
13 months agoAP MLD: Fix deferred first link BSS's authentication server init
Aditya Kumar Singh [Mon, 22 Apr 2024 11:19:03 +0000 (16:49 +0530)] 
AP MLD: Fix deferred first link BSS's authentication server init

Currently, RADIUS client, auth server, and 802.1X are copied from the
first link's BSS into the non-first link during its setup. However,
there could be a case where the first link is not initialized fully
because of ACS/HT40 SCAN/DFS. Hence, in such cases, NULL is getting
copied and later it leads to segmentation fault.

Initialize those on behalf of the first link in such case and update it
so that the next time other non-first link can use it.

Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
13 months agowlantest: Initial support for Multiple BSSID procedure
Jouni Malinen [Mon, 10 Jun 2024 18:27:00 +0000 (21:27 +0300)] 
wlantest: Initial support for Multiple BSSID procedure

Parse the Multiple BSSID element in Beacon frames and create and update
all the nontransmitted BSSs.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
13 months agoAdd a new QCA vendor attribute to set interface offload type
Balamurugan Mahalingam [Thu, 6 Jun 2024 01:53:21 +0000 (18:53 -0700)] 
Add a new QCA vendor attribute to set interface offload type

Userspace tools can use QCA_WLAN_VENDOR_ATTR_CONFIG_IF_OFFLOAD_TYPE to
configure the different below acceleration features (hardware, software)
on a per interface basis.

0 - No acceleration Packets are processed through the Linux kernel
networking stack.

1 - Software based acceleration: Packets are processed through the
shortcut forwarding engine (SFE) to bypass the Linux networking stack
for improved throughput performance. This option is applicable for AP,
STA, and Mesh mode and available for all radio designs. From the
performance aspect, this option consumes more CPU compared to the other
two options. Linux traffic control can be further applied with this
option to have more control on the traffic flows.

2 - Hybrid acceleration (software and hardware acceleration combined):
Packets are processed through both hardware and software in this case.
Packet classification is done by the hardware and then the packets are
delivered to software along with classification results as meta data.
Software can choose to do more classification/QoS based on use cases.
This is applicable for AP, STA, and Mesh modes and is available for all
radio designs. From the performance aspect, this option consumes
relatively less CPU compared to the SFE option above. Linux traffic
control rules cannot be applied with this option.

3 - Hardware based acceleration : Packets are processed through special
hardware (Direct Switch) rings which can directly forward the packets
between ethernet hardware and Wi-Fi hardware with very less software
involvement. This is applicable only for AP and STA modes; not
applicable for Mesh mode. From the performance aspect, this option
consumes very much less CPU compared to the other options. Linux traffic
control rules cannot be applied when this option is used. This option is
applicable only for specific radio designs. When this option is not
available, the default option (SFE) would be configured.

Signed-off-by: Balamurugan Mahalingam <quic_bmahalin@quicinc.com>
13 months agoAdd vendor attributes to detect data stall for consecutive TX no ack
Jianmin Zhu [Tue, 7 May 2024 09:53:44 +0000 (02:53 -0700)] 
Add vendor attributes to detect data stall for consecutive TX no ack

Add following vendor attributes to dynamically configure parameters to
detect data stall for consecutive TX no ack.
 - QCA_WLAN_VENDOR_ATTR_CONFIG_CONSECUTIVE_TX_NO_ACK_DURATION
 - QCA_WLAN_VENDOR_ATTR_CONFIG_CONSECUTIVE_TX_NO_ACK_THRESHOLD

Signed-off-by: Jianmin Zhu <quic_jianminz@quicinc.com>
13 months agoAdd new traffic type values for flow report vendor attribute
Kiran Kumar Lokere [Mon, 20 May 2024 05:07:17 +0000 (22:07 -0700)] 
Add new traffic type values for flow report vendor attribute

Define new traffic type values for
QCA_WLAN_VENDOR_ATTR_FLOW_STATS_TRAFFIC_TYPE attribute.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
14 months agotests: WNM BSS max idle period management
Jouni Malinen [Wed, 29 May 2024 18:43:26 +0000 (21:43 +0300)] 
tests: WNM BSS max idle period management

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
14 months agoWNM: Include BSS max idle period in STATUS command output
Jouni Malinen [Wed, 29 May 2024 18:01:28 +0000 (21:01 +0300)] 
WNM: Include BSS max idle period in STATUS command output

This makes it a bit easier to test BSS max idle period management.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
14 months agoWNM: AP configuration to allow BSS max idle period requests
Jouni Malinen [Wed, 29 May 2024 16:41:59 +0000 (19:41 +0300)] 
WNM: AP configuration to allow BSS max idle period requests

Add a new hostapd configuration parameter max_acceptable_idle_period to
allow the AP to accept per-STA requested BSS max idle periods.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
14 months agoWNM: Allow a specific BSS max idle period to be requested
Jouni Malinen [Wed, 29 May 2024 16:40:27 +0000 (19:40 +0300)] 
WNM: Allow a specific BSS max idle period to be requested

Add a new wpa_supplicant network profile parameter max_idle that can be
used to specify a specific maximum idle period in units of 1000 TUs
(1.024 s) for associations.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
14 months agotests: Use consistent indentation level for clear_regdom_state()
Jouni Malinen [Wed, 29 May 2024 10:21:02 +0000 (13:21 +0300)] 
tests: Use consistent indentation level for clear_regdom_state()

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
14 months agotests: More coverage for WNM BSS max idle period management
Jouni Malinen [Wed, 29 May 2024 10:20:02 +0000 (13:20 +0300)] 
tests: More coverage for WNM BSS max idle period management

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
14 months agoWNM: Group rekeying skipping with BSS max idle period management
Jouni Malinen [Wed, 29 May 2024 09:57:08 +0000 (12:57 +0300)] 
WNM: Group rekeying skipping with BSS max idle period management

Allow hostapd to be configured to not disconnect a STA if the STA fails
to reply to a group key handshake when BSS max idle period management is
used. This might be needed for some STAs that use aggressive power
saving (e.g., battery powered IoT devices).

This is disabled by default since this can delayed group rekeying
slightly and also to maintain the previous behavior. The more relaxed
operation can be enabled with the new configuration parameter
no_disconnect_on_group_keyerror=1.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
14 months agoWNM: Configurable BSS Max Idle Period management on AP
Jouni Malinen [Wed, 29 May 2024 09:41:51 +0000 (12:41 +0300)] 
WNM: Configurable BSS Max Idle Period management on AP

Allow AP's behavior for BSS Max Idle Period management to be configured.
Previously, this was automatically enabled for all CONFIG_WNM_AP=y
builds. This can now be changed with the new hostapd configuration
parameter bss_max_idle:
0 = BSS Max Idle Period management disabled
1 = BSS Max Idle Period management enabled
    (default and the previous behavior)
2 = BSS Max Idle Period management enabled with requirement for
    protected keep-alive frames

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
14 months agoAdd QCA vendor attribute to get number of TX/RX packets for each NSS
Aleti Nageshwar Reddy [Mon, 6 May 2024 10:01:33 +0000 (15:31 +0530)] 
Add QCA vendor attribute to get number of TX/RX packets for each NSS

Add support to get the number of TX/RX packets for each NSS value from
the driver.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
14 months agoAdd vendor attributes to configure TX/RX NSS and chains per band
Aditya Kodukula [Wed, 8 May 2024 01:04:31 +0000 (18:04 -0700)] 
Add vendor attributes to configure TX/RX NSS and chains per band

Add attributes to QCA_NL80211_VENDOR_SUBCMD_SET_WIFI_CONFIGURATION
vendor command to configure asymmetric TX/RX NSS and chains per band.
Also document driver's response when existing attributes to configure
TX/RX NSS and chains for all the bands 2.4 GHz and 5/6 GHz are used in
the same command.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
14 months agoAdd kernel documentation for nss and chain configuration vendor command
Aditya Kodukula [Tue, 7 May 2024 19:48:42 +0000 (12:48 -0700)] 
Add kernel documentation for nss and chain configuration vendor command

Add kernel documentation to the attributes used in the vendor command
QCA_NL80211_VENDOR_SUBCMD_SET_WIFI_CONFIGURATION to configure the NSS
and chains values used for transmitting and receiving the data.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
14 months agoAdd QCA vendor attribute for uplink delay jitter
Veerendranath Jakkam [Fri, 3 May 2024 15:24:33 +0000 (20:54 +0530)] 
Add QCA vendor attribute for uplink delay jitter

Add uplink delay jitter attribute in responses of
QCA_NL80211_VENDOR_SUBCMD_GET_STA_INFO vendor command.

Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
14 months agoP2P: Fix fast IP address allocation for invitation of a persistent group
mtk30479 [Wed, 24 Jan 2024 03:51:43 +0000 (11:51 +0800)] 
P2P: Fix fast IP address allocation for invitation of a persistent group

Allocate static IPv4 address in EAPOL frames during 4-way handshake
instead of DHCP when using P2P invitation. wpa_s->current_bss needs to
be set for the P2P specific IP address assignment mechanism to be used
in wpa_supplicant_rsn_supp_set_config(). This worked for the initial P2P
connection, but not for some cases reinvoking a persistent group.

Since there is only one AP (P2P GO) in the P2P client case, the
conditions added in commit 4d3be9cdd143 ("Postpone updating of
wpa_s->current_bss till association event") are not needed and the
easiest approach for this is to allow current_bss to be set for
p2p_in_invitation cases. If the GO P2P Interface Address (BSSID) could
be determined for all the related cases, this could be addressed a bit
more cleanly by setting the go_bssid argument for
wpas_start_p2p_client(), but that can be left as a possible future step.

Signed-off-by: tzu-meng wang <tzu-meng.wang@mediatek.com>