From nobody Thu May 15 19:14:42 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 4Zz0Jf6b2dz5wmfB; Thu, 15 May 2025 19:14:42 +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 4Zz0Jf604fz3nm1; Thu, 15 May 2025 19:14:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1747336482; 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=t3D+ctRixzVZ+OaRy8d9EEkkO2Qe9/xDr8iRqdPoTII=; b=tL1VizoHEc0zvQ3cV+X3K9rS4q+3Lo/m7vY98PuIfD9LKRdFOmst6RP/J2/UpMd/rizgpz Ogt7bSXnpYrUV4pdESC5OKpZG+uRBf5hfaO8kPD1hARiO4iay2Fc4HXCRyVwQ0GBifsrle 7eKCnwPves6PQIzyMKZHoOAcb4Txb1zwsZG48rqFJdePpBvjkb1M0mZF4dYiZXuvrdaBPl sceYFWtJG7yrR5jPXRsvDTvSeBjtDBzZpoCwX0Zci4pQjY9NOCbl6CalBKGKliBjviQDOj rBTBeTaKNJCaU/kKsKaqK26Wmj3xHMtBxD1dnaw1DL+5g38BgM5DD0r5G5yJYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1747336482; 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=t3D+ctRixzVZ+OaRy8d9EEkkO2Qe9/xDr8iRqdPoTII=; b=Xk410di99ByCZJDJTwrSaRDLekdDr/oVP4HgpUhv24q8/YK0A3c0bU8easvYDdy3lQJEOm xH676mvD6XP4Mbdfb+Hun+khY1nQIOuvCH/7Rjw7je7j4hJkkuewWXeruMAfk3k1rh5BE6 YikgIJGzg9ELaw+OOoAdnZuybxfGHprmiEoYb8QQFOpFJlnwRTbunKCn2XOgLvveYTYwlD fQKN8uAMeMQ9S27Y1/7okgbijhpV3Vu9quVu5NDcZuigi2Un3v5q3X3t6azZfgvWlTIFsc 3/q1Ns6IDM71tXwrnyxfvwp8l+ak14fPLoHi0ZWVUjwj9Y/Jt2JBmTDEa2zQCg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1747336482; a=rsa-sha256; cv=none; b=Zs+Ja0pGr9mBOd/7a+0E/BrkuJ6RJAfqJooDAok9XF01Ml5k/HY6h/JK0/5fP4k8mRBfQP oLHOPiIJaJ0X2uADKYkUQDLETUTgxf/hV3yIqws+vnBQWlV7/r6VexbSu57HdWk6p4l/Ab SEihMtPVOXGMoqYneWWoEln/NjlgBAanB50hVR+7sfXZ+B8oMGPXeMJbxYA8mLZN+lrEeK fdmxmN1BjOKVH+PGeaGoRyJdGIshL2VSAELmXXFTEYxC2OYXuwS8dTPvt65gLykTteWx0b NppcgLUqZ8dB5ELXhT7zJlaDjI7nmhCqIwIctf1iHynOna7MZfkNRnPv9nFvKQ== 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 4Zz0Jf5QHkzWHF; Thu, 15 May 2025 19:14:42 +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 54FJEgJ4002677; Thu, 15 May 2025 19:14:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 54FJEg2s002674; Thu, 15 May 2025 19:14:42 GMT (envelope-from git) Date: Thu, 15 May 2025 19:14:42 GMT Message-Id: <202505151914.54FJEg2s002674@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: 36174c38f9e3 - releng/14.3 - 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/releng/14.3 X-Git-Reftype: branch X-Git-Commit: 36174c38f9e3433e7fdb8b2f2923499dff67b2e7 Auto-Submitted: auto-generated The branch releng/14.3 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=36174c38f9e3433e7fdb8b2f2923499dff67b2e7 commit 36174c38f9e3433e7fdb8b2f2923499dff67b2e7 Author: Bjoern A. Zeeb AuthorDate: 2025-05-12 15:12:39 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-05-15 19:13:58 +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 Approved by: re (cperciva) (cherry picked from commit 16d987fe781780100a31df30b9edd79ebb54f957) (cherry picked from commit e0692e7bb6e8abcc55a2510dceea5f83e823a827) --- 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: