From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6FB3A37756C; Thu, 30 Jul 2026 14:46:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785422761; cv=none; b=bKJDXPP9yfPkvhlgjct5ac5ci7qN5oDk9PsMTF7QXUFp7RxdFq++2qAPkLDoUzMnRAgF3qUtCaTJcAtrb1899ibHqBhfG+7W/0nJB9kkcs6umxLqJ0A031evksNKtX4WTeD3hWrXZRAx9Wmd9JjUFHFOW5SSq9rhUZLvokknzck= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785422761; c=relaxed/simple; bh=/l72E87czLfPgMrgqPvSllZjkiCKCQ5bit2BxIkngAA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=gTE6wZ/YJLZVw6STpuH21yn/Zwo9yY2hilqjS50KvT8EXEkVWoQC27QoMu5eMQXtY3UzUs8FsqFHityblhfTV5h53Wuq8b34UXlSkK+ZyuqHJbeB+JAZitmHqPk9t/wtTJ/D3aH+OHOkN1zakifbTjgOg1YjLXsn94hJ9itlX78= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=nf8s+M46; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="nf8s+M46" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A2B101F000E9; Thu, 30 Jul 2026 14:45:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1785422760; bh=XYBW9NXOVY133Bu+JwteY8TtXCDTrSwFSe9SXk4gQWU=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=nf8s+M46x1GGJqoJuYsrcX2GglzJ2VC63JEmYZ0KLVEteSy9HYmukClLVk+XcL1dh a4pn347I/4jT+vrLWXR2XoRMUpjIUct3b/zRoWCzqgQVsYwtL+PkugH2bhefRWucu3 eyGnMdboXe9PLaDevZyKrYzaecnAipX61bKDO1KQ= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Doruk Tan Ozturk , Francesco Dolcini , Johannes Berg Subject: [PATCH 7.1 545/744] wifi: mwifiex: fix NULL dereference when the AP has HT-cap but no HT-oper Date: Thu, 30 Jul 2026 16:13:38 +0200 Message-ID: <20260730141455.860127064@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260730141444.267951807@linuxfoundation.org> References: <20260730141444.267951807@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 7.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Doruk Tan Ozturk commit c3d68e294cbb6a4090bb219d3dcaca85a011809b upstream. mwifiex_tdls_add_ht_oper() gates its follow-the-AP-bandwidth path on bss_desc->bcn_ht_cap being present, but then dereferences a different pointer, bss_desc->bcn_ht_oper: if (ISSUPP_CHANWIDTH40(priv->adapter->hw_dot_11n_dev_cap) && bss_desc->bcn_ht_cap && ISALLOWED_CHANWIDTH40(bss_desc->bcn_ht_oper->ht_param)) bcn_ht_cap and bcn_ht_oper are populated independently while parsing the associated AP's beacon in mwifiex_update_bss_desc_with_ie(): an AP that advertises an HT Capabilities element but no HT Operation element leaves bcn_ht_cap non-NULL and bcn_ht_oper NULL. Setting up a TDLS link to a peer while associated to such an AP then dereferences the NULL bcn_ht_oper and crashes the kernel. Every other bcn_ht_oper user in the driver NULL-checks it first. Guard on the pointer that is actually dereferenced. Found by 0sec automated security-research tooling (https://0sec.ai). Fixes: 396939f94084 ("mwifiex: add HT operation IE in TDLS setup confirm") Cc: stable@vger.kernel.org Assisted-by: 0sec:multi-model Signed-off-by: Doruk Tan Ozturk Reviewed-by: Francesco Dolcini Link: https://patch.msgid.link/20260716103042.88469-1-doruk@0sec.ai Signed-off-by: Johannes Berg Signed-off-by: Greg Kroah-Hartman --- drivers/net/wireless/marvell/mwifiex/tdls.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/net/wireless/marvell/mwifiex/tdls.c +++ b/drivers/net/wireless/marvell/mwifiex/tdls.c @@ -215,7 +215,7 @@ mwifiex_tdls_add_ht_oper(struct mwifiex_ /* follow AP's channel bandwidth */ if (ISSUPP_CHANWIDTH40(priv->adapter->hw_dot_11n_dev_cap) && - bss_desc->bcn_ht_cap && + bss_desc->bcn_ht_oper && ISALLOWED_CHANWIDTH40(bss_desc->bcn_ht_oper->ht_param)) ht_oper->ht_param = bss_desc->bcn_ht_oper->ht_param;