From nobody Fri Jul 1 14:57:46 2022 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 7137E8A3A4A; Fri, 1 Jul 2022 14:57:47 +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 4LZJGM1m1Wz4dyc; Fri, 1 Jul 2022 14:57:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1656687467; 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=p4k5RSw4UNt+PajvCGEiKgyVWVDNKQflkKzdn5yGxa0=; b=RN+zhueKIZ1bqHeDWclBX8irPGpxcMX8pIdma6R1tynfSZmuuF+3WEXUNyUr2lqL5Ww7PH rOipu6K3q6PiKeQLnNGIO128M2P2XC+ZEeF9FcZJFTIP+j54hr+v0EqVPbrPMDAer++CkR R3SeSzoHyliwcnQKJ0Cz9oEyIXylFNzhcfsp+iffqQvGJh0fu4tf8PfCJvchycoF2iZM6k R/rXF+lnfrRpoiSyO5AX2A3qkc3PBnur+mVC67HwbA5jHlZilmW88GL/9md8bAAHWru3Lj 1c2+f0KcVvEZ62WbqGw2QnJjvV1yLu62LPLiB3f8T48YLHccNInX+80Vm8yFEQ== 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 A4E181D89B; Fri, 1 Jul 2022 14:57:46 +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 261Evkmn057943; Fri, 1 Jul 2022 14:57:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 261Evk7K057942; Fri, 1 Jul 2022 14:57:46 GMT (envelope-from git) Date: Fri, 1 Jul 2022 14:57:46 GMT Message-Id: <202207011457.261Evk7K057942@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: d4d3ba68b7ec - stable/13 - LinuxKPI: 802.11: sync sta->addr in lkpi_iv_update_bss() 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: d4d3ba68b7ec94a7c0b2d2722e3242f04885f618 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1656687467; 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=p4k5RSw4UNt+PajvCGEiKgyVWVDNKQflkKzdn5yGxa0=; b=p2um3eJB4L+9fKvpFmJqLCXkD6KhRxvM8R5iujEOehbG/m0dts+D36Dd6rNAnQiQ7K1Cg1 dNzgKPAPbBgKzDXCt5qF6Tg9cttTCNvRGr8gQux1DjNtysLRBPO+VXwjcH79X6guwMBMdH hmbmeHHCGiT60gxkMfldoNnegsysqUJ1GLtG6pGyO2wtjqQlNhUQmsuxus4Gi4y6arLepU VRs/xpv5/vH5fYQ/0kQWQyqOqMYbCIxZjYF8969a1PJQV1JjZooK9RJWoU1tBvRNDuLild M/wMOzOFcILT2Cem2Nud6hv+vYmsfRcGigMltDufUunAcujjIW9zF1aT0ePOwg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1656687467; a=rsa-sha256; cv=none; b=bBNDZBlOonxdbeF7o97R/6O6AhF4nAK3l9Z68kkh4Fnsu/rI5yuuX3x2R5pMiVXIkN3J7D +oMcyJBR1DqA/uLfxIQvdCKF/ia1fqXgOGPvSWKTLY1kOOKC96yU/XGrRRpB1pdpfqtKkr 48C2/c89KVApKtOgj8dgz85l48OmKS1i4sMfh+7KRx8r1JcD4kZMeSUzSyXgniPnNyz/S8 f4Nik8ICiresh6F4ttW6ICA7RdRTJaGYwurOsPvQt+hazlNtXg7C3p6CoZ9HmE7samioqW o5nvqTZ9GM0I2p8P5h41f1DxnitwQBmEb7TFY+n2jCgWiGp3UtuVUxRTrhU3bQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=d4d3ba68b7ec94a7c0b2d2722e3242f04885f618 commit d4d3ba68b7ec94a7c0b2d2722e3242f04885f618 Author: Bjoern A. Zeeb AuthorDate: 2022-06-26 19:04:16 +0000 Commit: Bjoern A. Zeeb CommitDate: 2022-07-01 13:49:42 +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 (cherry picked from commit ed3ef56b29fd194a5ac0b820fd09bf01a4922bb7) --- 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 8a6ddf63e3f5..c19dca862d0a 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)); }