From nobody Sun Jun 14 22:32:26 2026 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 4gdp0V3NzTz6hZTn for ; Sun, 14 Jun 2026 22:32:26 +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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gdp0V259Nz3cKM for ; Sun, 14 Jun 2026 22:32:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781476346; 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=ZNq9a1U9RF3m87xE8yQQ7EFwnQC66tDQ13dxMDFjw4s=; b=UhtPkDDnAkpuZplN8k2BMgA2uZUxh9BFDfNTp8rztCueI0QHU5uxK0JVE5rgBtXzLS5FIF emvOlHPRlL4Q9VSsrmsCOpWiOIx+QqOWQYXGvnfciJjZofHnzmm1PYgT0EtGh49p421zw1 Qrdxh7gWcGbUliArxwCE2BAPVhNAtz63yoPLAoTyxjxFn15/9jrfUN1qL6Dl0t/kLb0Dj6 TvBM8fxLYTbUlHd7CSxPXyMZKKkv9q/Q7JeWm3ymYX5UTVJqHS/emdkKLhZY9j6FEZvNCu dsxfay0Jun4lA/VIkToI4BD42ZaC1hwlGh1uLHBvPRR7w2m1domKTZnOHhaxdQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781476346; a=rsa-sha256; cv=none; b=E2xlT4rKUk+Kd7c7rk4s7Bt109TLNDhl1kZGP1SPxxg/aHjJOzTt8GI89H12poI5yduQZG UBI1q3J6uQ4cpCPAfXb+3aY5aepQcSPOPRZ87L5qU+jnD0C4b1ISMicl+jKzjdW/OVv9Sg EN+Gg8k2WTHfUgPEgueeKcJiV3ek07zpSUFLt+jeCTVPsBP6UoxPSEQEiQdLV1ylTqU2ri HrTVAf+N47jHtI3eBiIrbRun3wqI3206SRfdc8BVVKvY3/j+kx2sYVjfNltmwl4iyEJJXJ x+X8yuNgXikXhD0nxmGO4DZrTDkof6T8hAL0D5vhHCkGMOF826k1sOr6o5lXXA== 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=1781476346; 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=ZNq9a1U9RF3m87xE8yQQ7EFwnQC66tDQ13dxMDFjw4s=; b=ARSYAGWDb3/8g4Md7A0gYmvoYQXBYvTXoinIIcQFkjJqJEQqwAOFkWD8AoPGRqKFECy5kZ Ss14cu9Z/1RQzCIYIR+VlG39QrSbSagW1AX8G/b2tcD47wxAaplQkxvmegVOVTadowBnGt D7tSVnkTNleU56g60EnfVjUq+VzckY7/1zPG/gdl4kMI3Pbpl5VpG435WfE1ioDHlOwh3O kvz1+RFMv3CTX2oU2WtzuPITaSmrs6SqR2r1kL67PJvjdZWM3VMTaq2lU8ffPYr55bARr1 w0ywg5cFIFVfK68ewfHQizGQu9zKeF7M899VfyeQmjJXIUdBFrvasfnI6fwydg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gdp0V1V1KzCl8 for ; Sun, 14 Jun 2026 22:32:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 42996 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 14 Jun 2026 22:32:26 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Bjoern A. Zeeb Subject: git: ff6c95d2c2df - main - LinuxKPI: 802.11: improve hw_crypto key operations 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: ff6c95d2c2dffbb024ad19ed306334a7993d964f Auto-Submitted: auto-generated Date: Sun, 14 Jun 2026 22:32:26 +0000 Message-Id: <6a2f2bfa.42996.7720a0f4@gitrepo.freebsd.org> The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=ff6c95d2c2dffbb024ad19ed306334a7993d964f commit ff6c95d2c2dffbb024ad19ed306334a7993d964f Author: Bjoern A. Zeeb AuthorDate: 2026-06-13 11:14:11 +0000 Commit: Bjoern A. Zeeb CommitDate: 2026-06-14 22:31:37 +0000 LinuxKPI: 802.11: improve hw_crypto key operations mt7921 would happily receive traffic (MC/BC) and decrypt it correctly when hw_crypto was used but TX would only have garbled data in frames. The problem came from the fact with keys for which we do not have an address the driver will pick the "sta" information from different places (driver view of sta or vif). In the downcall this is signalled by the sta argument being NULL as the linux keyconf has no address field. Us passing the sta for first the pairwise key and then also for the group key likely overwrote the pairwise key on the sta and allowed the MC/BC RX operations to succeed anyway (the observed behaviour). Software crypto was fully fine for mt7921 and showed no problems. Looking some other drivers: - iwlwifi/mld picks the ap_sta if the sta argument is NULL; thus it always worked with our previous logic and this went unnoticed. - rtw88 in rtw_sec_write_cam() decides whether to use the sta address or a broadcast address. - rtw89 in rtw89_cam_attach_sec_cam() picks the rtwsta_link if sta is not NULL and has follow-up logic checking on that. It is yet unclear if some of the MC problems observed on rtw8x stem from the same problem. Sponsored by: The FreeBSD Foundation MFC after: 3 days --- sys/compat/linuxkpi/common/src/linux_80211_macops.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/sys/compat/linuxkpi/common/src/linux_80211_macops.c b/sys/compat/linuxkpi/common/src/linux_80211_macops.c index caee1e0db563..b2e88719e103 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211_macops.c +++ b/sys/compat/linuxkpi/common/src/linux_80211_macops.c @@ -801,6 +801,22 @@ lkpi_80211_mo_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, goto out; } + /* + * Drivers will apply different logic depending on sta being set + * here or not and that depends on whether we have an address or + * not. wpa_spplucoant::driver_bsd::bsd_set_key() will set a + * broadcast address if we do not have one; further up in + * wpa_supplicant something presumably sets the broadcast address + * for group keys as well. + * We have to "undo" this here and set sta to NULL to avoid + * problems with hw_crypto in various drivers. + * We do this here so all set_key calls for (SET_KEY and DISABLE_KEY) + * are covered. + */ + MPASS(kc->_k != NULL); + if (is_broadcast_ether_addr(kc->_k->wk_macaddr)) + sta = NULL; + LKPI_80211_TRACE_MO("hw %p cmd %d vif %p sta %p kc %p", hw, cmd, vif, sta, kc); error = lhw->ops->set_key(hw, cmd, vif, sta, kc);