From nobody Mon Jun 29 06:34:21 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 4gpc261B9Mz6k5L3 for ; Mon, 29 Jun 2026 06:34:22 +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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gpc251vrLz4GRV for ; Mon, 29 Jun 2026 06:34:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782714861; 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=Yi1hCgjd5m1PsSQstuGXLpjE0aYyIyFl42hPbz12EuI=; b=BbJEN5XUKKGBNG6DTDJxHPBxR9WGsyG1NwOChzZpoC/Imnoga9TUBWk0epnOqwbWzECBtX wlQpz0HfxqW49QwJRuarD7mG/qC0+LNO+mlNA8yrZlO0iY2t6mcaSiE2AFqe5WCxl277Zb BwbZzahqwZVFSzgFcZ7VxmY2KiU8+f892DwYMXVAqkTPsodtAgxqGc9lirb2mFUZLHz+Tz xZjLdGdHxO2eN0KIl5m2GsG52gN9L3ZxYeujWn4YXNPnTiNk0f2pz7NNMObJTtDsznBS3T z/BaziksWGjDnB6sxCnothUgCVGlQfvpahdM8JBjbHzHZTsGaKq83mqhKwMLlQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1782714861; a=rsa-sha256; cv=none; b=IETLOPwW3BGxSfO3gh8euC2U9FquAY1ch/xLEvOCZAkx7fA6PYnOtQhLzelnFHG1J63wk+ QK2bo2YxVUNKSNFKo9fmQq9bDtarn4VQghDgFVwsb67zW9iE7BHrRa2NUWb+MaECFS224X 9eys1KXyTODzCsVCmRys6bXLSJCtQ1LO8BmJWZK7jjDncoTE6zOfZ27NESztN16kfhk81M qggPHM/pf5FCai/y5E7pMS6jSRsZ6Q4FMAdfHzXreM1FTbH2YDypUWLQXRSuLtBrXCsQEd JJLcofknq/6ek+9ENKh3K8gyN1ViVjmOPxnvZ+N27FqdRrVvMrHUwYoG2C2zsg== 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=1782714861; 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=Yi1hCgjd5m1PsSQstuGXLpjE0aYyIyFl42hPbz12EuI=; b=IBcYPat0GpqkF9LddV6NZa+BRTb1KrH1w8/3oDS1NPEy8dy54Jnai4e3OTlmbIxczTLf3L KScCYdplvIgUY5ejbbbL35TDRfRhhmS3yERMUzoeL+3wKUevjnSrlK33fzqdIjLdVRsdlW OffwPd3X155vFIIUYjxFerLIUYYLS2AgSyPYeV/2Nmo8nSJiAHR2ul74OMyG54frN7sl6k h2Ut4ewAbo/MYI7LGcbGEGsVyXBi3SOgT2lN9ESMri1igT1Z54Lh+Hr7hqGQP9wxKlGTjf 3aUxQ6bKvoHLb6APXpRnpLV19lFpLKZ/809urzgCDV3LK1VgmuMc8Xwyccu8CA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gpc250nywzmRf for ; Mon, 29 Jun 2026 06:34:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 46b0a by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 29 Jun 2026 06:34:21 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Bjoern A. Zeeb Subject: git: 7f0adc4da4cc - stable/15 - 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/stable/15 X-Git-Reftype: branch X-Git-Commit: 7f0adc4da4ccedc21a63fe6d39a105d05d4424a3 Auto-Submitted: auto-generated Date: Mon, 29 Jun 2026 06:34:21 +0000 Message-Id: <6a4211ed.46b0a.96cb72@gitrepo.freebsd.org> The branch stable/15 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=7f0adc4da4ccedc21a63fe6d39a105d05d4424a3 commit 7f0adc4da4ccedc21a63fe6d39a105d05d4424a3 Author: Bjoern A. Zeeb AuthorDate: 2026-06-13 11:14:11 +0000 Commit: Bjoern A. Zeeb CommitDate: 2026-06-29 03:52:27 +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 (cherry picked from commit ff6c95d2c2dffbb024ad19ed306334a7993d964f) --- 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);