]> git.ipfire.org Git - thirdparty/hostap.git/log
thirdparty/hostap.git
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>
14 months agoAdd a new QCA vendor attribute to set reduced power scan mode
Mukul Sharma [Fri, 3 May 2024 10:27:14 +0000 (15:57 +0530)] 
Add a new QCA vendor attribute to set reduced power scan mode

Userspace can use QCA_WLAN_VENDOR_ATTR_CONFIG_REDUCED_POWER_SCAN_MODE to
configure reduce power scan mode to the driver/firmware.

Signed-off-by: Mukul Sharma <quic_mukul@quicinc.com>
15 months agoAP MLD: Remove unused get_ml_rsn_info callback definition
Jouni Malinen [Thu, 25 Apr 2024 08:56:23 +0000 (11:56 +0300)] 
AP MLD: Remove unused get_ml_rsn_info callback definition

This is not used anymore after the previous AP MLD cleanup.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
15 months agotests: Cohosted MLDs connectivity testing
Aditya Kumar Singh [Mon, 22 Apr 2024 04:12:39 +0000 (09:42 +0530)] 
tests: Cohosted MLDs connectivity testing

Add a test case 'eht_mld_cohosted_connectivity' which creates two 2 link
AP MLDs and connect a 2 link MLD client to each one of them and test
data traffic.

Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
15 months agotests: Basic cohosted MLDs functionality testing
Aditya Kumar Singh [Mon, 22 Apr 2024 04:12:38 +0000 (09:42 +0530)] 
tests: Basic cohosted MLDs functionality testing

Add test cases to test basic cohosted MLDs functionality. Add helper
functions to create the configuration file, start hostapd instance.

Client connectivity test case will be added via a subsequent commit.

eht_mld_cohosted_discovery: 2 co-hosted MLDs without non-MLD RNR. Basic
bring up and beacon, MLD RNR, scan validation.

eht_mld_cohosted_discovery_with_rnr: Same like eht_mld_cohosted_discovery
but additionally non-MLD RNR (rnr=1) is also enabled. Validate the non-MLD
RNR as well.

Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
15 months agoUpdate Probe Response template on BSS color change
Rathees Kumar R Chinannan [Mon, 8 Apr 2024 06:35:16 +0000 (12:05 +0530)] 
Update Probe Response template on BSS color change

When AP is beaconing only on the 6 GHz band and unsol_bcast_presp
interval is set, AP sends unsolicited broadcast Probe Response frames
for in-band discovery. hostapd sent the Probe Response template for this
frame only when setting a new Beacon frame template.

Extend this to update the Probe Response template during BSS color
change.

Signed-off-by: Rathees Kumar R Chinannan <quic_rrchinan@quicinc.com>
15 months agoUpdate Probe Response template on channel switch
Rathees Kumar R Chinannan [Mon, 8 Apr 2024 06:35:16 +0000 (12:05 +0530)] 
Update Probe Response template on channel switch

When AP is beaconing only on the 6 GHz band and unsol_bcast_presp
interval is set, AP sends unsolicited broadcast Probe Response frames
for in-band discovery. hostapd sent the Probe Response template for this
frame only when setting a new Beacon frame template.

Extend this to update the Probe Response template during channel switch.

Signed-off-by: Rathees Kumar R Chinannan <quic_rrchinan@quicinc.com>
15 months agoMore generic unsolicited broadcast Probe Response template setup
Rathees Kumar R Chinannan [Mon, 8 Apr 2024 06:35:16 +0000 (12:05 +0530)] 
More generic unsolicited broadcast Probe Response template setup

When AP is beaconing only on the 6 GHz band and unsol_bcast_presp
interval is set, AP sends unsolicited broadcast Probe Response frames
for in-band discovery. hostapd sent the Probe Response template for this
frame only when setting a new beacon.

As a preparation for extending this functionality to other cases, move
the generation of the unsolicited broadcast Probe Response template into
a more generic function and data structure.

Signed-off-by: Rathees Kumar R Chinannan <quic_rrchinan@quicinc.com>
15 months agotests: Update opclass 124 test to use opclass 125
Jouni Malinen [Wed, 24 Apr 2024 18:06:33 +0000 (21:06 +0300)] 
tests: Update opclass 124 test to use opclass 125

This is needed to match the implementation change to map the 5 GHz
channels 149-175 to the global operating class 125 instead of 124.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
15 months agotests: Fix a typo in opclass test descriptions
Jouni Malinen [Wed, 24 Apr 2024 18:01:28 +0000 (21:01 +0300)] 
tests: Fix a typo in opclass test descriptions

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
15 months agoMake selection of current opclass more generic for 20 MHz UNI-III channels
Amith A [Mon, 8 Apr 2024 09:11:16 +0000 (14:41 +0530)] 
Make selection of current opclass more generic for 20 MHz UNI-III channels

According to IEEE Std 802.11-2020, Operating classes Table E-2 (Europe)
and Table E-6 (China) map channels in the range 149 to 161 to the global
operating class 125, while Table E-1 (United States) maps these channels
to global operating classes 125 and 124 as well. The global operating
class 125 contains all channels from the global operating class 124 and
some additional channels.

Hence, to make the selection of the current operating class generic, use
operating class 125 for all 20 MHz channels in the range 149 to 161.

Signed-off-by: Amith A <quic_amitajit@quicinc.com>
15 months agoFILS: Add Operating Class and Primary Channel in FD for non-PSC chan
Sriram R [Mon, 22 Apr 2024 17:08:42 +0000 (22:38 +0530)] 
FILS: Add Operating Class and Primary Channel in FD for non-PSC chan

If a non-PSC 6 GHz channel with bandwidth higher than 20 MHz is
configured, duplicate beacons/FD/UBPR will be transmitted in other 20
MHz channels of the current configured bandwidth to aid in faster scan.
In such cases the duplicate FD needs to carry the Operating Class and
Primary Channel subfields for non-AP STAs to identify the primary
non-PSC.

IEEE Std 802.11-2020, 9.6.7.36 (FILS Discovery frame format):
"The Operating Class subfield specifies the operating class of the
Primary Channel of the transmitting AP (see 9.4.1.36).

The Primary Channel subfield is set to the channel number of the primary
channel (see 11.15.2) if the FILS Discovery frame is transmitted as a
non-HT duplicate PPDU; otherwise, the subfield is not present."

Hence, add the Operating Class and Primary Channel subfields if the
current channel is non-PSC and the channel bandwidth is 40 MHz or
higher.

Signed-off-by: Sriram R <quic_srirrama@quicinc.com>
Signed-off-by: Karthikeyan Kathirvel <quic_kathirve@quicinc.com>
15 months agoDefine QCA vendor commands for flow stats/classification
Rakesh Pillai [Mon, 11 Mar 2024 10:33:42 +0000 (03:33 -0700)] 
Define QCA vendor commands for flow stats/classification

Add nl80211 vendor commands and attributes for the collection of flow
stats and classification.

- QCA_NL80211_VENDOR_SUBCMD_FLOW_STATS
- QCA_NL80211_VENDOR_SUBCMD_FLOW_CLASSIFY_RESULT
- QCA_NL80211_VENDOR_SUBCMD_ASYNC_STATS_POLICY
- QCA_NL80211_VENDOR_SUBCMD_CLASSIFIED_FLOW_REPORT

Signed-off-by: Rakesh Pillai <quic_pillair@quicinc.com>
15 months agonl80211: Update link bandwidth when receiving channel switch event
Chenming Huang [Wed, 17 Apr 2024 03:32:27 +0000 (09:02 +0530)] 
nl80211: Update link bandwidth when receiving channel switch event

There is a chance that the driver has switched the channel width so we
should update the bandwidth, too, when receiving a channel switch event.
Otherwise, this may cause out of sync for bandwidth between i802_link
and hostapd_config.

Signed-off-by: Chenming Huang <quic_chenhuan@quicinc.com>
15 months agoAP MLD: Set link_id field in hostapd_freq_params when setting up AP
Chenming Huang [Wed, 17 Apr 2024 01:23:30 +0000 (06:53 +0530)] 
AP MLD: Set link_id field in hostapd_freq_params when setting up AP

If not set, 0 is set by default and this could fail in the following
code path when link ID is not matching:
hostapd_drv_set_ap -> wpa_driver_nl80211_set_ap -> nl80211_set_channel

Signed-off-by: Chenming Huang <quic_chenhuan@quicinc.com>
15 months agoAdd QCA vendor subcommand to suspend/resume AP interface
Purushottam Kushwaha [Fri, 29 Mar 2024 12:27:36 +0000 (17:57 +0530)] 
Add QCA vendor subcommand to suspend/resume AP interface

Add a new QCA vendor subcommand QCA_NL80211_VENDOR_SUBCMD_AP_SUSPEND to
allow suspend and resume the AP interface. When an AP is suspended, it
disconnects all connected clients and stops all TX/RX operations on the
AP interface. The driver retains the AP configuration and on resume, all
AP operations are resumed with the same configuration.

This subcommand is also used in the event path to notify userspace about
AP suspended or resumed state changes.

This uses attributes defined in enum qca_wlan_vendor_attr_ap_suspend.

Signed-off-by: Purushottam Kushwaha <quic_pkushwah@quicinc.com>
15 months agotests: Fix a race condition in mesh_link_probe
Jouni Malinen [Mon, 22 Apr 2024 20:14:08 +0000 (23:14 +0300)] 
tests: Fix a race condition in mesh_link_probe

Wait for both peers to be connected before checking MESH_LINK_PROBE
behavior. Without this, it was possible for a MESH_LINK_PROBE command to
be issues before the specific peer had been added and that would result
in the nl80211 command failing.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
15 months agotests: Fix autogo_chan_switch to not drop HT capability
Jouni Malinen [Mon, 22 Apr 2024 13:17:39 +0000 (16:17 +0300)] 
tests: Fix autogo_chan_switch to not drop HT capability

This test case ended up dropping HT capability on channel switch which
is now resulting in mac80211 disconnecting. Avoid this by leaving HT
enabled. In addition, check the P2P Client events explicitly.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
15 months agotests: AP MLD with two links when only one of the links is negotiated
Jouni Malinen [Mon, 22 Apr 2024 10:31:06 +0000 (13:31 +0300)] 
tests: AP MLD with two links when only one of the links is negotiated

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
15 months agoAP MLD: Add MLO Link KDE for each affiliated link in EAPOL-Key 3/4
Jouni Malinen [Mon, 22 Apr 2024 11:35:35 +0000 (14:35 +0300)] 
AP MLD: Add MLO Link KDE for each affiliated link in EAPOL-Key 3/4

Previously, MLO Link KDE was added only for each link that was
negotiated for the ML association. However, IEEE Std 802.11be/D5.0,
12.7.6.1 defines the MLO Link KDE to be included "for each affiliated
AP" which is not constrained by what the non-AP MLD might have requested
or what the negotiation outcome for this particular ML association is.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
15 months agoAP MLD: Do not store per-supplicant AP RSNE/RSNXE information
Jouni Malinen [Mon, 22 Apr 2024 11:19:57 +0000 (14:19 +0300)] 
AP MLD: Do not store per-supplicant AP RSNE/RSNXE information

There is no need to store the AP MLD's RSNE/RSNXE within per-supplicant
data structure in struct wpa_state_machine since those elements are
available from the generic authenticator data in struct
wpa_authenticator.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
15 months agoAP MLD: Do not store per-supplicant AP link MAC address information
Jouni Malinen [Mon, 22 Apr 2024 11:08:57 +0000 (14:08 +0300)] 
AP MLD: Do not store per-supplicant AP link MAC address information

There is no need to store the AP MLD's link MAC addresses within
per-supplicant data structure in struct wpa_state_machine since those
MAC addresses are available from the generic authenticator data in
struct wpa_authenticator.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
15 months agoAP MLD: Do not store per-supplicant AP MLD MAC address information
Jouni Malinen [Mon, 22 Apr 2024 10:31:43 +0000 (13:31 +0300)] 
AP MLD: Do not store per-supplicant AP MLD MAC address information

There is no need to store the AP MLD MAC address within per-supplicant
data structure in struct wpa_state_machine since that MLD MAC address is
available from the generic authenticator data in struct
wpa_authenticator.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
15 months agoAdd a vendor attribute value to set aggressive roaming mode
Aleti Nageshwar Reddy [Thu, 28 Mar 2024 09:35:13 +0000 (15:05 +0530)] 
Add a vendor attribute value to set aggressive roaming mode

Add QCA_ROAMING_MODE_AGGRESSIVE in enum qca_roaming_policy to set
aggressive roaming mode. In addition, document the existing enum values.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
15 months agotests: WPA2-PSK from RADIUS during 4-way handshake with Session-Timeout
Jouni Malinen [Sun, 21 Apr 2024 08:35:25 +0000 (11:35 +0300)] 
tests: WPA2-PSK from RADIUS during 4-way handshake with Session-Timeout

Signed-off-by: Jouni Malinen <j@w1.fi>
15 months agoAllow Session-Timeout with PSK RADIUS during 4-way handshake
Lee Harding [Tue, 9 Apr 2024 22:06:38 +0000 (15:06 -0700)] 
Allow Session-Timeout with PSK RADIUS during 4-way handshake

When the RADIUS response included a Session-Timeout attribute, but is
otherwise valid (an Access-Accept with a valid Tunnel-Password), the
association still failed due to the strict comparison of the accepted
value with HOSTAPD_ACL_ACCEPT. Apparently this combination wasn't
previously tested.

Extend this to allow a packet containing a valid Session-Timeout
attribute to be accepted by extending the "success" comparison to
include HOSTAPD_ACL_ACCEPT_TIMEOUT.

Fixes: 1c3438fec4ba ("RADIUS ACL/PSK check during 4-way handshake")
Signed-off-by: Lee Harding <somerandomstring@gmail.com>
15 months agowpa_cli: Make WPA_EVENT_CHANNEL_SWITCH events accessible to action scripts
arun.jose [Mon, 15 Apr 2024 08:48:22 +0000 (14:18 +0530)] 
wpa_cli: Make WPA_EVENT_CHANNEL_SWITCH events accessible to action scripts

Make the channel switch complete event, WPA_EVENT_CHANNEL_SWITCH,
accessible to the action script.

Signed-off-by: arun.jose <arun.jose.wg@bp.renesas.com>
15 months agoFix center segment indexes in channel switch fallback to non-5 GHz cases
Jurijs Soloveckis [Tue, 16 Apr 2024 11:47:36 +0000 (11:47 +0000)] 
Fix center segment indexes in channel switch fallback to non-5 GHz cases

Hardcoded conversion for 5 GHz band was used, but this won't work for
other cases. Set the correct center segment indexes in channel switch
fallback for non-5GHz band.

Signed-off-by: Jurijs Soloveckis <jsoloveckis@maxlinear.com>
15 months agoP2P: Call normal SD query callback on RX/TX race
Benjamin Berg [Wed, 17 Apr 2024 12:45:24 +0000 (15:45 +0300)] 
P2P: Call normal SD query callback on RX/TX race

If the TX success response races with the RX frame then the state
machine was simply move to P2P_SD_DURING_FIND to continue the operation.
However, this does not take into account broadcast queries where the
callback handler updates the peer's sd_pending_bcast_queries.

Fix this by exporting the callback and calling it directly. This is
fine, as the operation is cancelled immediately afterwards, ensuring
that the callback is not called a second time.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
15 months agodbus: Use correct values for persistent group
Andrei Otcheretianski [Wed, 17 Apr 2024 12:28:12 +0000 (15:28 +0300)] 
dbus: Use correct values for persistent group

D-Bus expects "persistent" to be a bool (0/1) and crashes otherwise.
Since persistent may also be 2 convert it to boolean.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
15 months agowpa_supplicant: Do not allow fast associate before scanning 6 GHz
Ilan Peer [Mon, 8 Apr 2024 13:07:01 +0000 (16:07 +0300)] 
wpa_supplicant: Do not allow fast associate before scanning 6 GHz

In case the channel map was updated to include the 6 GHz but these channels
were not scanned yet, do not allow fast associate.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>