From nobody Mon May 12 19:16:11 2025 X-Original-To: dev-commits-src-all@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 4Zx8Tm0prQz5vj7Y; Mon, 12 May 2025 19:16:12 +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 4Zx8Tl6mhYz3cdB; Mon, 12 May 2025 19:16:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1747077372; 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=z9eXLpCxU//tbw0R3qFvQZyGrUn9UBFq0a9FjpqXMos=; b=FR82/9e6Q/vj+JpeN6HJ4ksJZ7bhxKv14JHqIrI7IeAJERDBM4Rr8/f58cdVOkl1GO6EEC smRRps4pGnCyzaTqsXEsOydxqe/XdnbUl4vcpv0Fo+NemyugqZJvL1bbGWblbrsMgZIDio 9HiBBBLs++xRg+pAwuIoFu0ffTMU7qMG7B0TjSRhv3fpfeBGXX5/TckhA+sdDVUKAvxg/7 AvN1SbFoeiOpbOvqvEsisjTC0qgaYUXGTr5vEn5VsS6pVgfoA4iTjtAvLu87IkwjhHSNVe qPsvT4tDExX/BmTAH937Z/GfF7e/laC97QuF66a7L1vXr2p9aMm2i8zx5nuHyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1747077372; 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=z9eXLpCxU//tbw0R3qFvQZyGrUn9UBFq0a9FjpqXMos=; b=GkAhOTl6n+kcxdzvsQkB02XKeSVdWRQdQ0VyQLvy7dRNOWPJ5iCl3VG7gEKlx/5/QaH0H9 /iuVQg5D6m4FlNQdp/aQ6/Xl3pHzDYWl1FNqNnSig3fXPVvUN3rMVU/UGW7bg0exzj5Oyk eS2SoVyYO7q2a/EocsoPXPGHQas4KUjimPnPD064/XDZXtAq3SYfoycA6cC3MhusxYRJMU TN43JTzgUFNYHODROibgctKzEczEfkkhncnFOktEl0amA0IUV+DJtobW1xNmq0U3drOhui Wa3ojJDyRFoNyM4dMRYZ7w0crTZuu7ccfS1oew5rGnoVC198CHBGBSWQWM8v1w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1747077372; a=rsa-sha256; cv=none; b=xxLpGx2Ntaen8sSf8AsFBY1vS4EfaRgjj/l6SRur6gVD2X5lCGgP4DI94oRTGQBmfSLdA2 ZUpAMybhyWIw8jnGwDrzWZHm/uIL5SlQwuoHCd3tEKVQiKBSqcbUHzVWExu2rm7t9yN3lW zWV0YzKZqephrZZNUgbE/uGmNYnRDJToq7QJYy7315XmYcSUmE4JDREBzgxLAz7fUrbHn+ OHZkjZFzDrqosj4Bn5feWl9t5uUzZotVlKIt5bzXgapNJm1/VFhwd14QSkpmXrdT0U5DOE z4x9mTj9ufNw1+KudGDebKVsCPK7kbMWhMjYHk76OmBjcjsomT88yThoxwN5Tg== 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 4Zx8Tl61XGz1SMr; Mon, 12 May 2025 19:16:11 +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 54CJGBdf004292; Mon, 12 May 2025 19:16:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 54CJGBGN004289; Mon, 12 May 2025 19:16:11 GMT (envelope-from git) Date: Mon, 12 May 2025 19:16:11 GMT Message-Id: <202505121916.54CJGBGN004289@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 16d987fe7817 - main - LinuxKPI: 802.11: make sure AUTH frames are not being sent if BSS changed List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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/main X-Git-Reftype: branch X-Git-Commit: 16d987fe781780100a31df30b9edd79ebb54f957 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=16d987fe781780100a31df30b9edd79ebb54f957 commit 16d987fe781780100a31df30b9edd79ebb54f957 Author: Bjoern A. Zeeb AuthorDate: 2025-05-12 15:12:39 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-05-12 19:15:13 +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 MFC after: 3 days --- 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 357f451a3f1a..4540c1aaf1c1 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: