commit bfe4f251a2f5827b10f2a033a426bb1783397c2d parent 884a1a84582872d926fd2d3fa83024211f8805ee Author: Owen Rafferty <owen@owenrafferty.com> Date: Sat, 14 Mar 2026 13:30:12 -0500 Merge tag '3.12' of https://git.kernel.org/pub/scm/network/wireless/iwd Release 3.12 Diffstat:
43 files changed, 158 insertions(+), 79 deletions(-)
diff --git a/ChangeLog b/ChangeLog @@ -1,3 +1,12 @@ +ver 3.12: + Fix issue with handling expiration of PMKSA. + Fix issue with handling uninitialized buffer and PMKID. + Fix issue with checking for PKCS#8 key parser in unit tests. + Fix issue with using -std=c23 compiler setting. + +ver 3.11: + Fix issue with interface registration before acquiring name. + ver 3.10: Fix issue with handling neighbor report on BSS TM request. Fix issue with handling deauth and FT association failure. diff --git a/autotests/testAPRoam/connection_test.py b/autotests/testAPRoam/connection_test.py @@ -40,7 +40,7 @@ class Test(unittest.TestCase): to_bss.wait_for_event('AP-STA-CONNECTED %s' % self.device.address) else: - self.device.wait_for_event("no-roam-candidates") + self.device.wait_for_event("no-roam-candidates", timeout=20) def test_disassoc_imminent(self): self.initial_connection() @@ -76,6 +76,8 @@ class Test(unittest.TestCase): (cls.bss_hostapd[1].bssid, "8f0000005102060603000000"), ] + cls.bss_hostapd[2].disable() + @classmethod def tearDownClass(cls): IWD.clear_storage() diff --git a/autotests/testSAE-roam/connection_test.py b/autotests/testSAE-roam/connection_test.py @@ -13,73 +13,61 @@ import testutil from config import ctx class Test(unittest.TestCase): - def validate_connection(self, wd, ft=True, check_used_pmksa=False): - device = wd.list_devices(1)[0] - + def connect(self, wd, device, hapd): # This won't guarantee all BSS's are found, but at least ensures that # at least one will be. device.get_ordered_network('TestFT', full_scan=True) - self.assertFalse(self.bss_hostapd[0].list_sta()) - self.assertFalse(self.bss_hostapd[1].list_sta()) + self.assertFalse(hapd.list_sta()) - device.connect_bssid(self.bss_hostapd[0].bssid) + device.connect_bssid(hapd.bssid) condition = 'obj.state == DeviceState.connected' wd.wait_for_object_condition(device, condition) - self.bss_hostapd[0].wait_for_event('AP-STA-CONNECTED %s' % device.address) + hapd.wait_for_event('AP-STA-CONNECTED %s' % device.address) self.assertFalse(self.bss_hostapd[1].list_sta()) testutil.test_iface_operstate(device.name) - testutil.test_ifaces_connected(self.bss_hostapd[0].ifname, device.name) - self.assertRaises(Exception, testutil.test_ifaces_connected, - (self.bss_hostapd[1].ifname, device.name, True, True)) + testutil.test_ifaces_connected(hapd.ifname, device.name) - # If PMKSA was used, hostapd should not include the sae_group key in - # its status for the station. - sta_status = self.bss_hostapd[0].sta_status(device.address) - if check_used_pmksa: - self.assertNotIn("sae_group", sta_status.keys()) - else: - self.assertIn("sae_group", sta_status.keys()) + def roam(self, wd, device, hapd_from, hapd_to): + device.roam(hapd_to.bssid) - device.roam(self.bss_hostapd[1].bssid) - - # Check that iwd is on BSS 1 once out of roaming state and doesn't + # Check that iwd is on hapd_to once out of roaming state and doesn't # go through 'disconnected', 'autoconnect', 'connecting' in between from_condition = 'obj.state == DeviceState.roaming' to_condition = 'obj.state == DeviceState.connected' wd.wait_for_object_change(device, from_condition, to_condition) - self.bss_hostapd[1].wait_for_event('AP-STA-CONNECTED %s' % device.address) + hapd_to.wait_for_event('AP-STA-CONNECTED %s' % device.address) testutil.test_iface_operstate(device.name) - testutil.test_ifaces_connected(self.bss_hostapd[1].ifname, device.name) + testutil.test_ifaces_connected(hapd_to.ifname, device.name) self.assertRaises(Exception, testutil.test_ifaces_connected, - (self.bss_hostapd[0].ifname, device.name, True, True)) + (hapd_from.ifname, device.name, True, True)) - if not ft: - return - device.roam(self.bss_hostapd[2].bssid) + def validate_connection(self, wd, ft=True, check_used_pmksa=False): + device = wd.list_devices(1)[0] - condition = 'obj.state == DeviceState.roaming' - wd.wait_for_object_condition(device, condition) + self.connect(wd, device, self.bss_hostapd[0]) - condition = 'obj.state != DeviceState.roaming' - wd.wait_for_object_condition(device, condition) + # If PMKSA was used, hostapd should not include the sae_group key in + # its status for the station. + sta_status = self.bss_hostapd[0].sta_status(device.address) + if check_used_pmksa: + self.assertNotIn("sae_group", sta_status.keys()) + else: + self.assertIn("sae_group", sta_status.keys()) - condition = 'obj.state == DeviceState.connected' - wd.wait_for_object_condition(device, condition) + self.roam(wd, device, self.bss_hostapd[0], self.bss_hostapd[1]) - self.bss_hostapd[2].wait_for_event('AP-STA-CONNECTED %s' % device.address) + if not ft: + return - testutil.test_iface_operstate(device.name) - testutil.test_ifaces_connected(self.bss_hostapd[2].ifname, device.name) - self.assertRaises(Exception, testutil.test_ifaces_connected, - (self.bss_hostapd[1].ifname, device.name, True, True)) + self.roam(wd, device, self.bss_hostapd[1], self.bss_hostapd[2]) def test_ft_roam_success(self): wd = IWD(True) @@ -121,6 +109,26 @@ class Test(unittest.TestCase): self.validate_connection(wd, True, check_used_pmksa=True) + def test_ft_roam_with_pmksa(self): + wd = IWD(True) + + self.bss_hostapd[0].set_value('wpa_key_mgmt', 'FT-SAE SAE') + self.bss_hostapd[0].reload() + self.bss_hostapd[0].wait_for_event("AP-ENABLED") + self.bss_hostapd[1].set_value('wpa_key_mgmt', 'FT-SAE SAE') + self.bss_hostapd[1].reload() + self.bss_hostapd[1].wait_for_event("AP-ENABLED") + self.bss_hostapd[2].set_value('wpa_key_mgmt', 'FT-PSK') + self.bss_hostapd[2].reload() + self.bss_hostapd[2].wait_for_event("AP-ENABLED") + + device = wd.list_devices(1)[0] + + self.connect(wd, device, self.bss_hostapd[0]) + + self.roam(wd, device, self.bss_hostapd[0], self.bss_hostapd[1]) + self.roam(wd, device, self.bss_hostapd[1], self.bss_hostapd[0]) + def test_reassociate_roam_success(self): wd = IWD(True) diff --git a/client/dpp.c b/client/dpp.c @@ -24,6 +24,7 @@ #include <config.h> #endif +#define _GNU_SOURCE #include <stdio.h> #include <linux/limits.h> diff --git a/client/known-networks.c b/client/known-networks.c @@ -279,35 +279,35 @@ static const struct proxy_interface *known_network_proxy_find_by_name( struct network_args network_args; struct l_queue *match; const struct proxy_interface *proxy; + size_t name_len; + char *args_name; if (!name) return NULL; - if (l_str_has_suffix(name, ".psk")) + name_len = strlen(name); + + if (l_str_has_suffix(name, ".psk")) { network_args.type = "psk"; - else if (l_str_has_suffix(name, ".8021x")) + name_len -= 4; + } else if (l_str_has_suffix(name, ".8021x")) { network_args.type = "8021x"; - else if (l_str_has_suffix(name, ".open")) + name_len -= 6; + } else if (l_str_has_suffix(name, ".open")) { network_args.type = "open"; - else + name_len -= 5; + } else network_args.type = NULL; - if (network_args.type) { - char *dot = strrchr(name, '.'); - - if (!dot) - /* This shouldn't ever be the case */ - return NULL; - - *dot = '\0'; - } - - network_args.name = name; + args_name = l_strndup(name, name_len); + network_args.name = args_name; match = proxy_interface_find_all(known_network_interface_type.interface, known_network_match, &network_args); + l_free(args_name); + if (!match) { display("No network with specified parameters was found\n"); return NULL; diff --git a/configure.ac b/configure.ac @@ -1,5 +1,5 @@ AC_PREREQ([2.69]) -AC_INIT([iwd],[3.10]) +AC_INIT([iwd],[3.12]) AC_CONFIG_HEADERS(config.h) AC_CONFIG_AUX_DIR(build-aux) diff --git a/src/ap.c b/src/ap.c @@ -24,6 +24,7 @@ #include <config.h> #endif +#define _GNU_SOURCE #include <errno.h> #include <linux/if_ether.h> #include <netinet/in.h> diff --git a/src/crypto.c b/src/crypto.c @@ -26,6 +26,7 @@ #include <config.h> #endif +#define _GNU_SOURCE #include <stdbool.h> #include <string.h> #include <errno.h> diff --git a/src/dpp.c b/src/dpp.c @@ -24,7 +24,9 @@ #include <config.h> #endif +#define _GNU_SOURCE #include <errno.h> +#include <string.h> #include <ell/ell.h> diff --git a/src/eap-aka.c b/src/eap-aka.c @@ -24,9 +24,11 @@ #include <config.h> #endif +#define _GNU_SOURCE #include <ctype.h> #include <stdio.h> #include <errno.h> +#include <string.h> #include <ell/ell.h> #include "src/missing.h" diff --git a/src/eap-gtc.c b/src/eap-gtc.c @@ -24,8 +24,10 @@ #include <config.h> #endif +#define _GNU_SOURCE #include <stdio.h> #include <errno.h> +#include <string.h> #include <ell/ell.h> #include "src/missing.h" diff --git a/src/eap-md5.c b/src/eap-md5.c @@ -24,8 +24,10 @@ #include <config.h> #endif +#define _GNU_SOURCE #include <stdio.h> #include <errno.h> +#include <string.h> #include <ell/ell.h> #include "src/missing.h" diff --git a/src/eap-mschapv2.c b/src/eap-mschapv2.c @@ -24,9 +24,11 @@ #include <config.h> #endif +#define _GNU_SOURCE #include <ctype.h> #include <stdio.h> #include <errno.h> +#include <string.h> #include <ell/ell.h> #include "src/missing.h" diff --git a/src/eap-peap.c b/src/eap-peap.c @@ -24,6 +24,7 @@ #include <config.h> #endif +#define _GNU_SOURCE #include <string.h> #include <stdio.h> #include <errno.h> diff --git a/src/eap-pwd.c b/src/eap-pwd.c @@ -24,7 +24,9 @@ #include <config.h> #endif +#define _GNU_SOURCE #include <stdio.h> +#include <string.h> #include <ell/ell.h> diff --git a/src/eap-sim.c b/src/eap-sim.c @@ -24,10 +24,12 @@ #include <config.h> #endif +#define _GNU_SOURCE #include <ctype.h> #include <stdio.h> #include <errno.h> #include <alloca.h> +#include <string.h> #include <ell/ell.h> #include "src/missing.h" diff --git a/src/eap-tls.c b/src/eap-tls.c @@ -24,9 +24,11 @@ #include <config.h> #endif +#define _GNU_SOURCE #include <string.h> #include <stdio.h> #include <errno.h> +#include <alloca.h> #include <ell/ell.h> #include "src/missing.h" diff --git a/src/eap-ttls.c b/src/eap-ttls.c @@ -24,6 +24,7 @@ #include <config.h> #endif +#define _GNU_SOURCE #include <string.h> #include <stdio.h> #include <errno.h> diff --git a/src/eap-wsc.c b/src/eap-wsc.c @@ -24,6 +24,7 @@ #include <config.h> #endif +#define _GNU_SOURCE #include <string.h> #include <stdio.h> #include <errno.h> diff --git a/src/eapol.c b/src/eapol.c @@ -24,6 +24,7 @@ #include <config.h> #endif +#define _GNU_SOURCE #include <string.h> #include <alloca.h> #include <linux/if_ether.h> diff --git a/src/erp.c b/src/erp.c @@ -24,6 +24,7 @@ #include <config.h> #endif +#define _GNU_SOURCE #include <stdint.h> #include <stdio.h> #include <errno.h> diff --git a/src/fils.c b/src/fils.c @@ -25,6 +25,8 @@ #include <config.h> #endif +#define _GNU_SOURCE +#include <stdlib.h> #include <ell/ell.h> #include "ell/useful.h" diff --git a/src/ft.c b/src/ft.c @@ -24,6 +24,7 @@ #include <config.h> #endif +#include <alloca.h> #include <ell/ell.h> #include "src/ie.h" diff --git a/src/handshake.c b/src/handshake.c @@ -24,6 +24,7 @@ #include <config.h> #endif +#define _GNU_SOURCE #include <string.h> #include <unistd.h> #include <errno.h> @@ -1267,6 +1268,7 @@ static struct pmksa *handshake_state_steal_pmksa(struct handshake_state *s) pmksa = l_new(struct pmksa, 1); pmksa->expiration = s->expiration; + s->expiration = 0; memcpy(pmksa->spa, s->spa, sizeof(s->spa)); memcpy(pmksa->aa, s->aa, sizeof(s->aa)); memcpy(pmksa->ssid, s->ssid, s->ssid_len); diff --git a/src/hotspot.c b/src/hotspot.c @@ -24,6 +24,7 @@ #include <config.h> #endif +#define _GNU_SOURCE #include <dirent.h> #include <errno.h> #include <stdio.h> diff --git a/src/knownnetworks.c b/src/knownnetworks.c @@ -24,6 +24,7 @@ #include <config.h> #endif +#define _GNU_SOURCE #include <sys/types.h> #include <dirent.h> #include <errno.h> diff --git a/src/main.c b/src/main.c @@ -200,29 +200,12 @@ static void request_name_callback(struct l_dbus *dbus, bool success, { if (!success) { l_error("Name request failed"); - goto fail_exit; + l_main_quit(); } - if (!l_dbus_object_manager_enable(dbus, "/")) - l_warn("Unable to register the ObjectManager"); - - if (!l_dbus_object_add_interface(dbus, IWD_BASE_PATH, - IWD_DAEMON_INTERFACE, - NULL) || - !l_dbus_object_add_interface(dbus, IWD_BASE_PATH, - L_DBUS_INTERFACE_PROPERTIES, - NULL)) - l_info("Unable to add %s and/or %s at %s", - IWD_DAEMON_INTERFACE, L_DBUS_INTERFACE_PROPERTIES, - IWD_BASE_PATH); - /* TODO: Always request nl80211 for now, ignoring auto-loading */ l_genl_request_family(genl, NL80211_GENL_NAME, nl80211_appeared, NULL, NULL); - return; - -fail_exit: - l_main_quit(); } static struct l_dbus_message *iwd_dbus_get_info(struct l_dbus *dbus, @@ -252,12 +235,25 @@ static void dbus_ready(void *user_data) { struct l_dbus *dbus = user_data; - l_dbus_name_acquire(dbus, "net.connman.iwd", false, false, false, - request_name_callback, NULL); - l_dbus_register_interface(dbus, IWD_DAEMON_INTERFACE, iwd_setup_deamon_interface, NULL, false); + + if (!l_dbus_object_manager_enable(dbus, "/")) + l_warn("Unable to register the ObjectManager"); + + if (!l_dbus_object_add_interface(dbus, IWD_BASE_PATH, + IWD_DAEMON_INTERFACE, + NULL) || + !l_dbus_object_add_interface(dbus, IWD_BASE_PATH, + L_DBUS_INTERFACE_PROPERTIES, + NULL)) + l_info("Unable to add %s and/or %s at %s", + IWD_DAEMON_INTERFACE, L_DBUS_INTERFACE_PROPERTIES, + IWD_BASE_PATH); + + l_dbus_name_acquire(dbus, "net.connman.iwd", false, false, false, + request_name_callback, NULL); } static void dbus_disconnected(void *user_data) diff --git a/src/mschaputil.c b/src/mschaputil.c @@ -24,6 +24,9 @@ #include <config.h> #endif +#define _GNU_SOURCE +#include <string.h> + #include <ell/ell.h> #include "src/missing.h" diff --git a/src/netconfig.c b/src/netconfig.c @@ -24,6 +24,7 @@ #include <config.h> #endif +#define _GNU_SOURCE #include <errno.h> #include <arpa/inet.h> #include <net/if_arp.h> @@ -31,6 +32,7 @@ #include <limits.h> #include <string.h> #include <fcntl.h> +#include <sys/param.h> #include <sys/types.h> #include <sys/stat.h> #include <unistd.h> diff --git a/src/netdev.c b/src/netdev.c @@ -24,6 +24,7 @@ #include <config.h> #endif +#define _GNU_SOURCE #include <stdlib.h> #include <alloca.h> #include <stdio.h> @@ -32,8 +33,8 @@ #include <linux/if.h> #include <linux/if_packet.h> #include <linux/if_ether.h> -#include <arpa/inet.h> #include <linux/filter.h> +#include <arpa/inet.h> #include <sys/socket.h> #include <errno.h> diff --git a/src/network.c b/src/network.c @@ -24,6 +24,7 @@ #include <config.h> #endif +#define _GNU_SOURCE #include <sys/types.h> #include <stdio.h> #include <errno.h> diff --git a/src/p2p.c b/src/p2p.c @@ -24,6 +24,7 @@ #include <config.h> #endif +#define _GNU_SOURCE #include <stdlib.h> #include <linux/rtnetlink.h> #include <linux/if_ether.h> @@ -35,6 +36,7 @@ #include <netinet/in.h> #include <arpa/inet.h> #include <linux/if.h> +#include <sys/param.h> #include <ell/ell.h> diff --git a/src/resolve.c b/src/resolve.c @@ -24,6 +24,7 @@ #include <config.h> #endif +#define _GNU_SOURCE #include <errno.h> #include <arpa/inet.h> #include <sys/stat.h> diff --git a/src/rfkill.c b/src/rfkill.c @@ -24,6 +24,7 @@ #include <config.h> #endif +#define _GNU_SOURCE #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> diff --git a/src/simutil.c b/src/simutil.c @@ -24,9 +24,11 @@ #include <config.h> #endif +#define _GNU_SOURCE #include <ctype.h> #include <stdio.h> #include <errno.h> +#include <string.h> #include <ell/ell.h> #include "src/missing.h" diff --git a/src/station.c b/src/station.c @@ -1360,9 +1360,10 @@ build_ie: bss->ssid, bss->ssid_len, info.akm_suites); if (pmksa) { - handshake_state_set_pmksa(hs, pmksa); - info.num_pmkids = 1; - info.pmkids = hs->pmksa->pmkid; + if (!L_WARN_ON(!handshake_state_set_pmksa(hs, pmksa))) { + info.num_pmkids = 1; + info.pmkids = hs->pmksa->pmkid; + } } } diff --git a/src/udev.c b/src/udev.c @@ -24,6 +24,7 @@ #include <config.h> #endif +#define _GNU_SOURCE #include <errno.h> #include <unistd.h> #include <sys/socket.h> diff --git a/src/wsc.c b/src/wsc.c @@ -24,6 +24,7 @@ #include <config.h> #endif +#define _GNU_SOURCE #include <errno.h> #include <stdio.h> #include <ell/ell.h> diff --git a/src/wscutil.c b/src/wscutil.c @@ -28,6 +28,7 @@ #include <stdarg.h> #include <errno.h> #include <stdio.h> +#include <strings.h> #include <ell/ell.h> diff --git a/tools/probe-req.c b/tools/probe-req.c @@ -24,6 +24,7 @@ #include <config.h> #endif +#define _GNU_SOURCE #include <stdio.h> #include <stdlib.h> #include <sys/types.h> diff --git a/unit/test-eapol.c b/unit/test-eapol.c @@ -27,6 +27,7 @@ #include <stdio.h> #include <string.h> #include <assert.h> +#include <sys/stat.h> #include <linux/if_ether.h> #include <ell/ell.h> @@ -3923,6 +3924,18 @@ static bool aes_precheck(const void *data) static bool pkcs8_precheck(const void *data) { + struct stat st; + + /* + * Despite the path, this directory exists whether the module + * is external or built-in. + */ + if (stat("/sys/module/pkcs8_key_parser", &st) < 0) + return false; + + if (!S_ISDIR(st.st_mode)) + return false; + return (IS_ENABLED(HAVE_PKCS8_SUPPORT) && l_cipher_is_supported(L_CIPHER_AES) && l_cipher_is_supported(L_CIPHER_AES_CBC) && diff --git a/unit/test-sae.c b/unit/test-sae.c @@ -25,6 +25,7 @@ #endif #include <string.h> +#include <alloca.h> #include <assert.h> #include <ell/ell.h> diff --git a/wired/ethdev.c b/wired/ethdev.c @@ -24,6 +24,7 @@ #include <config.h> #endif +#define _GNU_SOURCE #include <stdio.h> #include <errno.h> #include <unistd.h>