From nobody Thu May 15 09:53:03 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Zylrc2qYZz5w40q; Thu, 15 May 2025 09:53:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Zylrb6gMHz3C8p; Thu, 15 May 2025 09:53:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1747302783; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VFrB52Oelg6X33k1Z3lfbJHuIs6CrzLFC821lBfjKHI=; b=v8NSB9Z/u+qjHDlcFpbXPXo6hPVNWUE28Sdm1wxqW16rqcBPpOUfDoHxi+b3zCwdQbpOj5 I/zcdocpkILsKLIqo6s5O/hA7ar2HzT+4qTh3wbkLMXuv0H/ntKzjtDs6XJZSZpBjLUcOt 6b7Y6TZpya0u1IAJjfhFhggsL3udrT/97gNs2voTWMPKOkHcWxWzAssAAOYhoP1IfxgSVM aoRx0wEEkihjHTFOUxqRBwEm2zXInkk17hbis3WPaxcR+N/FCnoYTF/wmvFexEoIxZD3Mz hHXAnXxOwPzYOqA0MRGpszBz/5AykLTn3a7mCeD3EnPhfuesDgiNPRqWCASQTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1747302783; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VFrB52Oelg6X33k1Z3lfbJHuIs6CrzLFC821lBfjKHI=; b=NUkkRhBWOkOfXthU5yigaZO3fyJ2gJ21+iGwlqvb5zjHAXFZAcPU96a4Y7cvnc+XbPWiUN uGN9Mj+u2tLV0BpCUYs7PNeSZ5QaxI0HofLb8djxGa0jXmS48m4LTqLPVgE7X4jLbP5Uzm no5Sj3WmDUN7bkQb1WyQlGqjWOM/FG7nOxLS+pe+d2sIqm3SXMXJKluWsSzuDzWULW3PFJ G1A6ISU7UR4a6G03Bjyb2xJUzU46dU+Z5SshQZy0S+HShlz1eDxcqc6DVQ0oTuymEYkqmH DbeTczRqSnNlOpeNwcpRULMiSOQqAB/pBlcoN/wDcUuETAeyjOXNrGeq6Q/pTQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1747302784; a=rsa-sha256; cv=none; b=DBttTnzU5FM3N5cNvpJDitpUH+JbMMEeuQeOi/CQkdXPiOJUaKlFCD+EvAIwzrY6ivRKNz FXvxGRwHJb2KkKzKvZ4q22t/x0TSLLGuz4W7NilrbO8/yCTSvXDr4o8yagGvfGWhMqadc/ s5cG0iqp5YM7ajLDmVpFHsHG+NeppYaTxRyO1a45wkD67Tfgdl1J9i9vqAMNRn7YEgWPCe GVNrJ6tp9Iwdlq+jhvo63Z6U5/ZdEvP1jGBf/u3/LsA0JNoQu86r7DeknAlAgDCBqIFFEY /KP4VMBty5Yk4FQ4E/xaCj7HXb+BlT6jmF+epgAxKVMp8S+Ck7D14cixffeCLw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Zylrb6CGcz1BHn; Thu, 15 May 2025 09:53:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 54F9r3kb050904; Thu, 15 May 2025 09:53:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 54F9r31S050901; Thu, 15 May 2025 09:53:03 GMT (envelope-from git) Date: Thu, 15 May 2025 09:53:03 GMT Message-Id: <202505150953.54F9r31S050901@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: e0692e7bb6e8 - stable/14 - LinuxKPI: 802.11: make sure AUTH frames are not being sent if BSS changed List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e0692e7bb6e8abcc55a2510dceea5f83e823a827 Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=e0692e7bb6e8abcc55a2510dceea5f83e823a827 commit e0692e7bb6e8abcc55a2510dceea5f83e823a827 Author: Bjoern A. Zeeb AuthorDate: 2025-05-12 15:12:39 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-05-15 09:50:56 +0000 LinuxKPI: 802.11: make sure AUTH frames are not being sent if BSS changed iwlwifi keeps logging 'Invalid TXQ id' even after previous changes to catch the BSS changed. The reason for this is that we do not error in the SCAN -> AUTH path as otherwise we would not have the state machine get us back to SCAN to clear up firmware state before auth/assoc to the new BSS. If we are not in synch as net80211 just swapped the iv_bss from under us, disable the TX queue for the (old) lsta to prevent the AUTH frame sent from sta_newstate() reaching the driver. After all we are not trying to authenticate to that node (sta) anymore. Sponsored by: The FreeBSD Foundation PR: 274382 (cherry picked from commit 16d987fe781780100a31df30b9edd79ebb54f957) --- sys/compat/linuxkpi/common/src/linux_80211.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index fb9a4bc0177b..82eaa64790b4 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -2021,6 +2021,7 @@ lkpi_sta_scan_to_auth(struct ieee80211vap *vap, enum ieee80211_state nstate, int struct ieee80211_prep_tx_info prep_tx_info; uint32_t changed; int error; + bool synched; /* * In here we use vap->iv_bss until lvif->lvif_bss is set. @@ -2211,14 +2212,6 @@ lkpi_sta_scan_to_auth(struct ieee80211vap *vap, enum ieee80211_state nstate, int __func__, ni, ni->ni_drv_data)); lsta = ni->ni_drv_data; - /* - * Make sure in case the sta did not change and we re-add it, - * that we can tx again. - */ - LKPI_80211_LSTA_TXQ_LOCK(lsta); - lsta->txq_ready = true; - LKPI_80211_LSTA_TXQ_UNLOCK(lsta); - /* Insert the [l]sta into the list of known stations. */ list_add_tail(&lsta->lsta_list, &lvif->lsta_list); @@ -2292,10 +2285,10 @@ lkpi_sta_scan_to_auth(struct ieee80211vap *vap, enum ieee80211_state nstate, int ieee80211_ref_node(lsta->ni); lvif->lvif_bss = lsta; if (lsta->ni == vap->iv_bss) { - lvif->lvif_bss_synched = true; + lvif->lvif_bss_synched = synched = true; } else { /* Set to un-synched no matter what. */ - lvif->lvif_bss_synched = false; + lvif->lvif_bss_synched = synched = false; /* * We do not error as someone has to take us down. * If we are followed by a 2nd, new net80211::join1() going to @@ -2305,9 +2298,20 @@ lkpi_sta_scan_to_auth(struct ieee80211vap *vap, enum ieee80211_state nstate, int * to net80211 as we never used the node beyond alloc()/free() * and we do not hold an extra reference for that anymore given * ni : lsta == 1:1. + * Problem is if we do not error a MGMT/AUTH frame will be + * sent from net80211::sta_newstate(); disable lsta queue below. */ } LKPI_80211_LVIF_UNLOCK(lvif); + /* + * Make sure in case the sta did not change and we re-added it, + * that we can tx again but only if the vif/iv_bss are in sync. + * Otherwise this should prevent the MGMT/AUTH frame from being + * sent triggering a warning in iwlwifi. + */ + LKPI_80211_LSTA_TXQ_LOCK(lsta); + lsta->txq_ready = synched; + LKPI_80211_LSTA_TXQ_UNLOCK(lsta); goto out_relocked; out: