From nobody Wed Jul 16 15:21:51 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 4bj0CN5C2sz61dDT; Wed, 16 Jul 2025 15:21:52 +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 4bj0CN0ZnLz4LtQ; Wed, 16 Jul 2025 15:21:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752679312; 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=rwwN3lP0DQmTCC4xq+n+n3z+LaBbsRLZ11U55YMBuz8=; b=M20oPaqxi5YH1+iXncQxjmx97tv2Cmny+CxQll9yy+CwYWmp+fXkmBuVOg4xuzD+UtKtnq ylOHbWE6F/xzQj37w2IwLE1u+PIn07ouWvpAHaHb35C0rE3o6QKiQugeKZwZTKqZWd0JHd eRXRVKRhGJjLWzkjWUrnn8VF6pwuDKuiANODPq6P5+wHrUxCoDEOrCIK8r/R6ZjXkloNOc 9JkT4uT6hZ3dO/lgecUk70AouXs0uFgKAqM7OU4SYW4/z5biv68h0G5pH7ONWFjJQs/1RQ FJrHZAiWfd9poCAmjwebhgRL7J8237Cg8hoSfPjKEIypBIHvzIH4UKWttfHCJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752679312; 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=rwwN3lP0DQmTCC4xq+n+n3z+LaBbsRLZ11U55YMBuz8=; b=u8CVrELyhwycf158uXpyvlZQVl7TI7wQUkh9Y6TcnaB5q643G0LTgPzMC3lOSYQrgGcOXi +4sUZFkTOb0nw9lrmZYDntzSZzLC4k8U+WAHqB7mT826LcijTLuPmDAglsAUYm76ew77/W gUEq7FR+LqGTrHcZ8NtZUXjlKSbGezlVsP1Oxn68mroy+sKSgWa1FwcLOBnqrPK49gqPBB 7tSW8SJ6UMt7htl93OyW5e1Dwg62p9Z6hpay1nQwax6EhcJWe8LZcJBiDEmtEzGPkgSJA/ BoGrXaLshDY+QI171MUbNRxx4BqbWRgtlL+iuj1Qv3QUlqnH3BZytaqq3ZE4og== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752679312; a=rsa-sha256; cv=none; b=au6VA/zoCx5jBy8TO5Mpo61ofvAnJ84jbseQ5a31rS1I9OfjyVFuq8mUNWb5MBqYsrYYWY HuVikCXVZCmwX9qG3reJB2XI3/2Pe8EHd1aQUdRuC5+JpCtio8XyMDFJqNxzDvsSvxWRxC 7Nj1yylIOIIX8qLtkm3YfwIWPfnS19/be7+0yHLhtlCYAn8irepYic/olwlHevXD5UAyPE rDVvAtdPEfrIPR6ulTTcK1aDB+aBiVQDXgKdAcf1+Ss9iuwuOkyMpc8dGHMTZvHOHVOj98 7hsF6748SmdhrpOGY9ypnlb8HClks46/ca95XJynK8L387mcVYeZbQYwDqvNXA== 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 4bj0CM6vlmzsS; Wed, 16 Jul 2025 15:21:51 +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 56GFLpxQ041733; Wed, 16 Jul 2025 15:21:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56GFLpbI041730; Wed, 16 Jul 2025 15:21:51 GMT (envelope-from git) Date: Wed, 16 Jul 2025 15:21:51 GMT Message-Id: <202507161521.56GFLpbI041730@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Adrian Chadd Subject: git: 33e8fc370c18 - main - net80211: don't dereference a NULL HTINFO IE if it's presented 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: adrian X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 33e8fc370c186c693c32f909305520de7c75853a Auto-Submitted: auto-generated The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=33e8fc370c186c693c32f909305520de7c75853a commit 33e8fc370c186c693c32f909305520de7c75853a Author: Adrian Chadd AuthorDate: 2025-06-11 18:10:03 +0000 Commit: Adrian Chadd CommitDate: 2025-07-16 15:12:11 +0000 net80211: don't dereference a NULL HTINFO IE if it's presented ieee80211_vht_get_vhtflags() is checking the htinfo IE for the 20/40MHz flag as part of deciding valid channel widths. However, in the hostapd path, the ASSOC_REQ/REASSOC_REQ path will parse the IEs, do some HT/VHT setup, then call ieee80211_ht_updatehtcap_final(). In a HT ASSOC/REASSOC request there won't be a HTINFO IE, however ieee80211_vht_get_vhtflags() still checks for it, leading to a panic. Instead, treat it as if we don't yet know if it's HT40 or not. I'm not sure if we should do that or have it just do _RETURN_CHAN_BITS(0). Differential Revision: https://reviews.freebsd.org/D50794 --- sys/net80211/ieee80211_ht.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/sys/net80211/ieee80211_ht.c b/sys/net80211/ieee80211_ht.c index 5ec80e3646b8..c28f124648a1 100644 --- a/sys/net80211/ieee80211_ht.c +++ b/sys/net80211/ieee80211_ht.c @@ -1951,6 +1951,11 @@ do { \ (vap->iv_vht_flags & IEEE80211_FVHT_VHT) == 0) _RETURN_CHAN_BITS(0); + /* + * TODO: should we bail out if there's no htinfo? + * Or just treat it as if we can't do the HT20/HT40 check? + */ + /* * The original code was based on * 802.11ac-2013, Table 8-183x-VHT Operation Information subfields. @@ -1962,8 +1967,12 @@ do { \ */ htinfo = (const struct ieee80211_ie_htinfo *)ni->ni_ies.htinfo_ie; - ht40 = ((htinfo->hi_byte1 & IEEE80211_HTINFO_TXWIDTH) == - IEEE80211_HTINFO_TXWIDTH_2040); + if (htinfo != NULL) + ht40 = ((htinfo->hi_byte1 & IEEE80211_HTINFO_TXWIDTH) == + IEEE80211_HTINFO_TXWIDTH_2040); + else + ht40 = false; + can_vht160 = can_vht80p80 = can_vht80 = false; /* 20 Mhz */