From nobody Sun Jun 26 21:27:06 2022 X-Original-To: dev-commits-src-main@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 7CED887F38A; Sun, 26 Jun 2022 21:27:06 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4LWP7t2bZtz3jDW; Sun, 26 Jun 2022 21:27:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1656278826; 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=U6DV0ITZCBHSIgvk4FukD0c/kmCOCQDXQkoFg/dKfLM=; b=H7skDSF7u9LKpsw7clE4pnjCu76NLAdeqNBWpV/aqPcgtRwNx/zEw8d23WtoVSlq+bmkK/ gZH1tJudw4bB9wRgcQP7jMKMR6sLwHu1hy50d/DaqJ+5UKd/hcTDSgLa+QnPs9CldpCJj/ K31tWAKNbUXwYIczqt2uu9AE0LTfsmDzJXV0yGUVnvm3hv8sq7GQ93Fa+z06JhbXhJl2sF X4zysUM7rhosJmxQzkWQKKsYkLPjB9/VLBnJw6Jct+A93OiT8jSxyeuAqkpPMUjHohQWrX GdWbPz90oi85+erV4kjRkXKVdOdPynhHZXA9tq517tV7cUUDu9d7RT6pf4ivUQ== 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 30C761BB88; Sun, 26 Jun 2022 21:27:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 25QLR6k8007097; Sun, 26 Jun 2022 21:27:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 25QLR6U5007096; Sun, 26 Jun 2022 21:27:06 GMT (envelope-from git) Date: Sun, 26 Jun 2022 21:27:06 GMT Message-Id: <202206262127.25QLR6U5007096@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: ed3ef56b29fd - main - LinuxKPI: 802.11: sync sta->addr in lkpi_iv_update_bss() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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: ed3ef56b29fd194a5ac0b820fd09bf01a4922bb7 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1656278826; 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=U6DV0ITZCBHSIgvk4FukD0c/kmCOCQDXQkoFg/dKfLM=; b=xs96v5VBpL+4QBgndpeAt+BFoTJCPloYRcIa7r2jBsrwE6bjNhaLxhs669L/wvQthVctub XLECYAqpvbmmDwvmNJ6nyBR7L/Anb7mtdfFXkgyYxJgz/PHSYHVgLiNKmaF4EV/CgMIZM4 TS/2jxEXq9J7Z91uvypGDcBM8WY0wkr2YvW9sc1DMvlnXkReGVCPrIEZ2H8YQm2rJZRxy6 SwNch+2bHRpUFaJ+9r+dZYb+ePyJ1je48+Qpd76PzTc/nLwawUmegoGoRJquCakz/npRSx dWZZB+9HcAFZVnfBeWsI6+3SpWk6CDyuIyjaTEneu/DJNm2TfvNmEmTqmvX73A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1656278826; a=rsa-sha256; cv=none; b=rm8NDhMxade30hIPwtE7NIexfyPRejD4Yj9CZ1gsH9yTdMiXrKsoQSQ5IUGMPwaZuum5yQ hRISk7W6+Odi9kbO45U6GNBbWtEHgjsCVO5mjrCOr8pnLUIBjSxSs7P/qtCjeSyY16b/Xw w2Z37U1Dlj92miTA6OXwEb+KWjtaQZFul7FBQmfvXNMK1onCrGz3xkRNS+IdA3oxIgCU0X Y3XysV3tPPUJCXewJ+de7/BnIzRd//iBZmvPU2Yez5YTi3yiH3UCtLjaYkbUGVNNGBQ317 MT9KohlVgeLc0k4AdH3o12jcdqbugT4SSY6vQ1tb+SG/2CE6dQhqSz8w2b4z1g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=ed3ef56b29fd194a5ac0b820fd09bf01a4922bb7 commit ed3ef56b29fd194a5ac0b820fd09bf01a4922bb7 Author: Bjoern A. Zeeb AuthorDate: 2022-06-26 19:04:16 +0000 Commit: Bjoern A. Zeeb CommitDate: 2022-06-26 19:04:16 +0000 LinuxKPI: 802.11: sync sta->addr in lkpi_iv_update_bss() In lkpi_iv_update_bss() introduced in d9f59799fc3e7 we swap lsta and along with that sta and drv state if ni gets reused and swapped under us by net80211. What we did not do was to sync sta->addr which later (usually in lkpi_sta_assoc_to_run) during a bss_info update cause problems in drivers (or firmware) as the BSSID and the station address were not aligned. If this proves to hold up to fix iwlwifi issues seem on firmware for older chipsets, multi-assoc runs, and rtw89 (which this fixes) we should add asserts that lkpi_iv_update_bss() can only happen in pre-auth stages and/or make sure we factor out synching more state fields. Found debugging: rtw89 MFC after: 3 days --- sys/compat/linuxkpi/common/src/linux_80211.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 0328ff1c7c98..321fa47a4088 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -2073,8 +2073,8 @@ lkpi_iv_update_bss(struct ieee80211vap *vap, struct ieee80211_node *ni) struct lkpi_vif *lvif; struct ieee80211_node *obss; struct lkpi_sta *lsta; + struct ieee80211_sta *sta; - lvif = VAP_TO_LVIF(vap); obss = vap->iv_bss; #ifdef LINUXKPI_DEBUG_80211 @@ -2101,13 +2101,20 @@ lkpi_iv_update_bss(struct ieee80211vap *vap, struct ieee80211_node *ni) lsta = obss->ni_drv_data; obss->ni_drv_data = ni->ni_drv_data; ni->ni_drv_data = lsta; - if (lsta != NULL) + if (lsta != NULL) { lsta->ni = ni; + sta = LSTA_TO_STA(lsta); + IEEE80211_ADDR_COPY(sta->addr, lsta->ni->ni_macaddr); + } lsta = obss->ni_drv_data; - if (lsta != NULL) + if (lsta != NULL) { lsta->ni = obss; + sta = LSTA_TO_STA(lsta); + IEEE80211_ADDR_COPY(sta->addr, lsta->ni->ni_macaddr); + } out: + lvif = VAP_TO_LVIF(vap); return (lvif->iv_update_bss(vap, ni)); }