From nobody Mon Jun 29 06:34:22 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 4gpc265hzDz6k5cP 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 4gpc262fB2z4Gqc for ; Mon, 29 Jun 2026 06:34:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782714862; 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=mjEySsAJLmkI6h95OSi5wpyUeG3eVWV9YcVwfJkqHYI=; b=gIZho80ycDu9iqYwH9alg5wEvTMEksfhP9tBThOTYlzP8hxKCiLjQaHWGW8WV13jhUCULd PIQLL0YQ6amnTDsKxaA+WSufQ9ACb13/1uEP9ovTYEP1ky/skdl+/RkhjvZyjwh+B0IBTB b8xHR6uHxjUWpEf7WIy3DIr9zlMe75+9wQDq4bamv8Mfxd8hvG4Q7wq+vcix4u7dN7b60x 1GJlR/hUIkwWnybUzyAGDKzGAjwQ5Di6lwMIL3Ucjrm+VBqBOBXaME/28EHiwTnP6ftsta TbjrH1Gxr++nPYOavo7fLMtE1O+SW+iRxhywt9P2gg/meL/GcCpBVDXdAuoCOA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1782714862; a=rsa-sha256; cv=none; b=FBZIuSUw8cwOuUqUK5VdC/w08EFJ5vSa2k9zyJ9scEvFvFdb2NxwH/64DRoCVrmeCrjVrQ I5Jrgxr6RYUuBIBPAojKUeay6H7Ve0Qs7NeDzIsU3VSXdcgaIfX45DuOJwzyZCHRr1okJO wLnnhPvGp4OPdI0+tvDFk6EKjAxtNXX5bPx+HWyB/OSEvsPsZOrmeYDSn7+BBV36nYfITn RrvBVSi62jKzf03BTm6yO8caom8u3YqDl+O4TDsPXahV4rJf+mqq0OugKS9LD1tS09f5tG Bfj4Ilz3a/ULT2ogNBbPs0IW5em19Z00uG5uzU1AEWKGT0sckUpkCkPbCEC0yA== 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=1782714862; 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=mjEySsAJLmkI6h95OSi5wpyUeG3eVWV9YcVwfJkqHYI=; b=A3K9YkUvgCoj5Y2GPEV6gtDM9R4I5FlZl1X2vniIflM+hkUolaAH/RioDAuXz4i3kEAcPK TkjF8vxqGontvjgwxN3D+A/LA8BrgXwcOU9uU/xRwQOjloenVH1XfIF1rcBBXh44dzFtmc fL8xEFlTINqpQnbaZebe2B6m4u0LQAzKuMi7PX66ESwoWSkhyJCYegToEk1NRyu6dYXQSD pNJxIvUfdr+0LHvcUiVIHdYKk0L3cjvdvqBdDEzECMv9FHuO4eFiq3iw5+b/3ZlycQqehD mqZoT9V06f8Bd/m7EKs0OZKBLw7qbm7tjcPPBVCFtZu4fQU5hm4ONcJc0JScmg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gpc261dgzzmRg for ; Mon, 29 Jun 2026 06:34:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 47780 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 29 Jun 2026 06:34:22 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Bjoern A. Zeeb Subject: git: 280b4c9f19a2 - stable/15 - LinuxKPI: 802.11: force update of net80211 crypto key flags 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: 280b4c9f19a2a8e97ad0334296ba43842fcf7f97 Auto-Submitted: auto-generated Date: Mon, 29 Jun 2026 06:34:22 +0000 Message-Id: <6a4211ee.47780.437c5cac@gitrepo.freebsd.org> The branch stable/15 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=280b4c9f19a2a8e97ad0334296ba43842fcf7f97 commit 280b4c9f19a2a8e97ad0334296ba43842fcf7f97 Author: Bjoern A. Zeeb AuthorDate: 2026-06-13 11:25:42 +0000 Commit: Bjoern A. Zeeb CommitDate: 2026-06-29 03:53:00 +0000 LinuxKPI: 802.11: force update of net80211 crypto key flags Several drivers (rtw8x, mt76) do not announce the supported ciphers suites in the wiphy instance. This means we never populate net80211 ic_cryptocaps on device creation and thus not announcing any supported hw crypto offload forcing a fallback to software crypto. However when the mac80211 (*set_key) succeeds we know we can offload crypto. At that point the net80211 key flags have IEEE80211_KEY_SWCRYPT set which we want to clear. Historically the net80211 API does not allow this though there should be no ill side effects (base on a quick code inspection). We thus have to DECONST the key argument for now. It is expected that with MFP support this will need to become a common operation and the API will need to change as we will only get the information of some details from the driver on a per-cipher case when the (*set_key) downcall returns. Sponsored by: The FreeBSD Foundation (cherry picked from commit 31ded414b1282abdebcb24c18cc6dbebf84210f2) --- sys/compat/linuxkpi/common/src/linux_80211.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 1882c2a12c09..f612b559df99 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -1570,6 +1570,7 @@ lkpi_iv_key_set(struct ieee80211vap *vap, const struct ieee80211_key *k) struct ieee80211_sta *sta; struct ieee80211_node *ni; struct ieee80211_key_conf *kc; + struct ieee80211_key *wk; uint32_t lcipher; uint16_t exp_flags; uint8_t keylen; @@ -1699,6 +1700,16 @@ lkpi_iv_key_set(struct ieee80211vap *vap, const struct ieee80211_key *k) kc, kc->keyidx, kc->hw_key_idx, kc->flags, IEEE80211_KEY_FLAG_BITS); #endif + /* + * Getting here means we support HW crypto offload. + * Some drivers do not set the wiphy [n_]cipher_suites and thus we + * never populate ic_cryptocaps. which means SWCRYPT will be set and we + * should disable this now (before possibly setting other SW flags + * again for when we need partial SW support). + */ + wk = __DECONST(struct ieee80211_key *, k); + wk->wk_flags &= ~IEEE80211_KEY_SWCRYPT; + exp_flags = 0; switch (kc->cipher) { case WLAN_CIPHER_SUITE_TKIP: @@ -1718,8 +1729,8 @@ lkpi_iv_key_set(struct ieee80211vap *vap, const struct ieee80211_key *k) #ifdef __notyet__ /* Do flags surgery; special see linuxkpi_ieee80211_ifattach(). */ if ((kc->flags & IEEE80211_KEY_FLAG_GENERATE_MMIC) != 0) { - k->wk_flags &= ~(IEEE80211_KEY_NOMICMGT|IEEE80211_KEY_NOMIC); - k->wk_flags |= IEEE80211_KEY_SWMIC; + wk->wk_flags &= ~(IEEE80211_KEY_NOMICMGT|IEEE80211_KEY_NOMIC); + wk->wk_flags |= IEEE80211_KEY_SWMIC; ic->ic_cryptocaps &= ~IEEE80211_CRYPTO_TKIPMIC } #endif @@ -1742,9 +1753,9 @@ lkpi_iv_key_set(struct ieee80211vap *vap, const struct ieee80211_key *k) #ifdef __notyet__ /* Do flags surgery. */ if ((kc->flags & IEEE80211_KEY_FLAG_GENERATE_IV_MGMT) == 0) - k->wk_flags |= IEEE80211_KEY_NOIVMGT; + wk->wk_flags |= IEEE80211_KEY_NOIVMGT; if ((kc->flags & IEEE80211_KEY_FLAG_GENERATE_IV) == 0) - k->wk_flags |= IEEE80211_KEY_NOIV; + wk->wk_flags |= IEEE80211_KEY_NOIV; #endif ieee80211_free_node(ni);