From nobody Sun Jul 13 19:31:03 2025 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 4bgFtH49Zgz61NFq; Sun, 13 Jul 2025 19:31:03 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bgFtH26Myz3k0L; Sun, 13 Jul 2025 19:31:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752435063; 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=Sp4CqLkLYU3uCftCUyGaiPFsT6sQOMJnWCeqm9w6m50=; b=hq0Xw09CQYxFwT7WeGJ9FMWEBlBJgIVoUxjSMxO1kt2R/EP+ur6wBjI4zIzClZj5AXknd5 DT/fEj57VA3Qdlm430K/1oEfxRzH09q9H1gNM1J6ZbDs9jThhMHklHHvE87XGsXI+Q0WQ3 EVQWeJv8mutnQyGt/UHypVoYYuODb/47HMflPd1mzDNfNcnNg3KWGZv1BeSAh9oDvcsr4C iLWSp+SqY6/yhZG/6Ds1H+A/klLwBRZ/naZk0jw8yCdAi/szlM268gtzYHD7KU6sPZ2eUv IhaYELcJND/+34SLK/m/5DNhUovqNTinTiWyf4/Obb/tWvmQ3HY4+3BU7c2gOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752435063; 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=Sp4CqLkLYU3uCftCUyGaiPFsT6sQOMJnWCeqm9w6m50=; b=a3TJ3HgtLTEdM4/YsOvmRbFFSCAZFJtq7mVw5gnvAbJdZC5HWcda6ZBh1QCpjehJFdQd1s kPkk9pGM+8eNs7ufL/s3s8FZ8SDqkcmuzJtOJW0IAuzgw5fVoG7kgaL9IHSe+2pwv6MwnD auOmbcxbHlecDcYehCfzQ7V2ds6SACDG7BOarJFVkoGn6tRtcp20x44/Vtoj00GCYzRnO+ 6IRMB1b4i6kARy79/FqqPkRaHvDVtQKD1MF81FfOxYcnjFhXKVKR+AD5SqtVLJpnsrrLDv wLlYibsX5/JlS8cpR2vHHNLyvkNQWPK2lwupwhKrH3H/miOujApenPQYntBYDw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752435063; a=rsa-sha256; cv=none; b=BAKQAvoswKEa3dapWjeiEC3t/46RadXISeqS+HTrlzF/O3h5ubeOF+0ydYvCeDPfrv+9Wt V6i4GBvWHyEPGo/JjjjiH7ncnoyitPGsuX1QeooS8ja1eO+iALX5ohUqcPmnygU62ApL+m qlO1dir0s5D0uadH3ELwEwEIweRPVHinA1DXnwhEd3Bfx6exALaGNyDbvAhnWPq/vb18h+ BELBfRw6fdGMaW+PD0+zYqyhzl+lOqiFMChuhK5gmcAmOnotQZDP0ix67xnI54Xu5uG8uG aJpl9q9HVCz87IpSAOeD+kWJOCIvaddZJQ8rANQWE5HqzcneVrkT1Z0rAxkWDA== 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 4bgFtH0tD0z6Yk; Sun, 13 Jul 2025 19:31:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56DJV3Zq069496; Sun, 13 Jul 2025 19:31:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56DJV3wJ069493; Sun, 13 Jul 2025 19:31:03 GMT (envelope-from git) Date: Sun, 13 Jul 2025 19:31:03 GMT Message-Id: <202507131931.56DJV3wJ069493@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: 5c16917bac65 - stable/14 - net80211: in ieee80211_sta_join() only do_ht if HT is avail 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 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/14 X-Git-Reftype: branch X-Git-Commit: 5c16917bac65f6d44ec8208861ace61835d38825 Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=5c16917bac65f6d44ec8208861ace61835d38825 commit 5c16917bac65f6d44ec8208861ace61835d38825 Author: Bjoern A. Zeeb AuthorDate: 2025-06-18 21:58:20 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-07-13 19:25:02 +0000 net80211: in ieee80211_sta_join() only do_ht if HT is avail In ieee80211_sta_join() there are currently two ways to set "do_ht": (1) after checking HT IEs are avail, and (2) after checking VHT IEs are avail and we are not on 2GHz. In the latter case no one checks that HT IEs are available and when we hit ieee80211_ht_updateparams_final() htinfo may be NULL and we panic. Avoid this by only checking for VHT if do_ht was set. No VHT without HT IEs. While here switch do_ht to be a bool. Sponsored by: The FreeBSD Foundation PR: 287625 Fixes: 51172f62a753f Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D50923 (cherry picked from commit f51c794cbc80682931d47264e3c18329bae0a2c1) --- sys/net80211/ieee80211_node.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sys/net80211/ieee80211_node.c b/sys/net80211/ieee80211_node.c index ae22dc036bb6..288f25ec9681 100644 --- a/sys/net80211/ieee80211_node.c +++ b/sys/net80211/ieee80211_node.c @@ -939,7 +939,7 @@ ieee80211_sta_join(struct ieee80211vap *vap, struct ieee80211_channel *chan, { struct ieee80211com *ic = vap->iv_ic; struct ieee80211_node *ni; - int do_ht = 0; + bool do_ht; ni = ieee80211_alloc_node(&ic->ic_sta, vap, se->se_macaddr, __func__, __LINE__); @@ -1015,6 +1015,7 @@ ieee80211_sta_join(struct ieee80211vap *vap, struct ieee80211_channel *chan, * association request/response, the only appropriate place * to setup the HT state is here. */ + do_ht = false; if (ni->ni_ies.htinfo_ie != NULL && ni->ni_ies.htcap_ie != NULL && vap->iv_flags_ht & IEEE80211_FHT_HT) { @@ -1022,7 +1023,7 @@ ieee80211_sta_join(struct ieee80211vap *vap, struct ieee80211_channel *chan, ieee80211_ht_updateparams(ni, ni->ni_ies.htcap_ie, ni->ni_ies.htinfo_ie); - do_ht = 1; + do_ht = true; } /* @@ -1031,7 +1032,7 @@ ieee80211_sta_join(struct ieee80211vap *vap, struct ieee80211_channel *chan, * * For now, don't allow 2GHz VHT operation. */ - if (ni->ni_ies.vhtopmode_ie != NULL && + if (do_ht && ni->ni_ies.vhtopmode_ie != NULL && ni->ni_ies.vhtcap_ie != NULL && vap->iv_vht_flags & IEEE80211_FVHT_VHT) { if (IEEE80211_IS_CHAN_2GHZ(ni->ni_chan)) {