From nobody Fri Feb 27 02:30:18 2026 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 4fMXNq1HgGz6T824 for ; Fri, 27 Feb 2026 02:30:19 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fMXNp5zfTz425P for ; Fri, 27 Feb 2026 02:30:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1772159418; 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=WFkk/HCSpuPOz4Bk8JBk9nnkZWSxPM87P4phDjeezFM=; b=cIM/y+MNmckIpYqrB998InFfGBSRcfl1lc992muKfGLodKyjxFmm4OOYID1b8I/MpNwZiA OI5F9yRJoEzC+GINEpHZJkJHeHD++Q2qsNTRPf5ygsqA3eyMw6ygzTVyK3ZSiw+KejnMmT 3OMyfyiH3Gt4wL3EI6tsqkruIeQzgYSR/OPHgVZ5ctEElzLj+bSKCl/DojPkAU/vkINb3k dfAsheTL0qs/yOJTxsWsSC+ZXCiSj6Q/5b2XVUTj1o7Ljtp8TaN3uyekULjeU+tDa9mi1N H+ITPoKc1E/6+Buz0tsFLqQ81NVkoZJ0n31N0W7TDsL/JKWcVtRSWQ09/pVETA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1772159418; a=rsa-sha256; cv=none; b=eOvwWNzk1sWsyrzL3kwVzCHsQCYc8H9WzMvUutyoLcJu3LjGhu2wyoYfnxTilL6/aKjh9a pJebSkc+U3AyJK0KdzzTxeSYwiLANcVh2NlBwrzR78IXrz8ehjBieMY5uwtJ5PT/6PIaTJ gH+lSXTor/DurtYNc6bU4C0ENE5HG/RhlMFoG/LJRR+J0kN5+bz3gT7VgFKE6NI3RJBWD9 u+GGKAHPkaYjd783f92lduoznhd/yvHkAPGc25CSqRlH80IGS/QPuhzEa/Ag8IcY8TGf5/ DiExr5l94wBM4CrcxOADdYfynADqPZpJe+OcSJ0dmvLSvdfZOjsAus2oYsAYTg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1772159418; 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=WFkk/HCSpuPOz4Bk8JBk9nnkZWSxPM87P4phDjeezFM=; b=P/Iv1Rvp5tWdZmm50OCcAgCpiKTbD6Y1emq6x3xxeBWV4eFalCmWKbuSet3xNFoUi+vwKd Byg0QnXFTo0+ugn0/4yrW9FFqdlcF1MAatz7Jh6ObEihE/I560f3Jof45n9Sp+uUZ0+SnP qYAiBT/L3OSaQ9xOz/q9Gf8+/8GJvo4YVGhG4OAOaWbBB0ugq0r+WxPQOIVtNeSrUAM8kv iYHpge+JS3iA1wPZiDRyEc2PUAfXyWOiNJGPYaTr5oIqB6Dy4xHue5rgNrHeUG4bQLPwIg m7cuUkXf0I8eyWmzH6dzhKrGLjTGMaZSzKEu6Tr97V5/tyYiQpP/fmnvLyv/0w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fMXNp5HbMzyZr for ; Fri, 27 Feb 2026 02:30:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 22800 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 27 Feb 2026 02:30:18 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Bjoern A. Zeeb Subject: git: 64af3362df76 - stable/15 - LinuxKPI: 802.11: adjust assoc check before key deletion 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/15 X-Git-Reftype: branch X-Git-Commit: 64af3362df76e0c7cdce5c0f64ff9ccef09bb155 Auto-Submitted: auto-generated Date: Fri, 27 Feb 2026 02:30:18 +0000 Message-Id: <69a101ba.22800.7e7800d6@gitrepo.freebsd.org> The branch stable/15 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=64af3362df76e0c7cdce5c0f64ff9ccef09bb155 commit 64af3362df76e0c7cdce5c0f64ff9ccef09bb155 Author: Bjoern A. Zeeb AuthorDate: 2026-02-24 23:51:43 +0000 Commit: Bjoern A. Zeeb CommitDate: 2026-02-26 23:09:34 +0000 LinuxKPI: 802.11: adjust assoc check before key deletion There is a discrepancy between the vif assoc state and the sta state (see comment in lkpi_sta_run_to_init()). Adjust the check in lkpi_iv_key_delete() and add it to lkpi_sta_del_keys() so that we can take way the keys after whatever comes first: the sta went away from AUTHORIZED (RUN) or if the vif is no longer marked assoc. This is needed as we may only take the sta down partially back to State 2 (cf. 802.11-2024, Figure 11-23) and key material is no longer valid before the vif gets cleaned up and the sta is removed entirely. Sponsored by: The FreeBSD Foundation (cherry picked from commit 96a57fc4bf4edca9a579cc47f9058253c11f8313) --- sys/compat/linuxkpi/common/src/linux_80211.c | 30 +++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index e80cf9436b3a..550bd417c529 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -1373,6 +1373,15 @@ lkpi_sta_del_keys(struct ieee80211_hw *hw, struct ieee80211_vif *vif, return (0); lockdep_assert_wiphy(hw->wiphy); + + if (vif->cfg.assoc && lsta->state == IEEE80211_STA_AUTHORIZED) { + if (linuxkpi_debug_80211 & D80211_TRACE_HW_CRYPTO) + ic_printf(lsta->ni->ni_ic, + "%d %lu %s: vif still assoc; not deleting keys\n", + curthread->td_tid, jiffies, __func__); + return (0); + } + ieee80211_ref_node(lsta->ni); error = 0; @@ -1452,6 +1461,15 @@ lkpi_iv_key_delete(struct ieee80211vap *vap, const struct ieee80211_key *k) */ lockdep_assert_wiphy(hw->wiphy); + ni = ieee80211_ref_node(vap->iv_bss); + lsta = ni->ni_drv_data; + if (lsta == NULL) { + ic_printf(ic, "%s: ni %p (%6D) with lsta NULL\n", + __func__, ni, ni->ni_bssid, ":"); + ieee80211_free_node(ni); + return (0); + } + /* * While we are assoc we may still send packets. We cannot delete the * keys as otherwise packets could go out unencrypted. Some firmware @@ -1462,30 +1480,24 @@ lkpi_iv_key_delete(struct ieee80211vap *vap, const struct ieee80211_key *k) * How to test: run 800Mbit/s UDP traffic and during that restart your * supplicant. You want to survive that. */ - if (vif->cfg.assoc) { + if (vif->cfg.assoc && lsta->state == IEEE80211_STA_AUTHORIZED) { if (linuxkpi_debug_80211 & D80211_TRACE_HW_CRYPTO) ic_printf(ic, "%d %lu %s: vif still assoc; not deleting keys\n", curthread->td_tid, jiffies, __func__); + ieee80211_free_node(ni); return (0); } if (IEEE80211_KEY_UNDEFINED(k)) { ic_printf(ic, "%s: vap %p key %p is undefined: %p %u\n", __func__, vap, k, k->wk_cipher, k->wk_keyix); + ieee80211_free_node(ni); return (0); } if (vap->iv_bss == NULL) { ic_printf(ic, "%s: iv_bss %p for vap %p is NULL\n", __func__, vap->iv_bss, vap); - return (0); - } - - ni = ieee80211_ref_node(vap->iv_bss); - lsta = ni->ni_drv_data; - if (lsta == NULL) { - ic_printf(ic, "%s: ni %p (%6D) with lsta NULL\n", - __func__, ni, ni->ni_bssid, ":"); ieee80211_free_node(ni); return (0); }