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 A3A953750CF; Thu, 30 Jul 2026 15:07:44 +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=1785424065; cv=none; b=uGWLx+rO9NiiZ3BI4gplGxCRwWkmSJSpr+qoOwseAoCbWyIrjkaipfQ2/e8VXAHsG82Z8UqV50hYKcusk/lLKparp6MpvpcJR2TT3zDCC5/ljRob2SunaTSFHL1ta5H/J7WzinqQ27ZLRA3JnDzGRcWdI3Rg+kM2ip3e6EnzwQw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785424065; c=relaxed/simple; bh=apG137fZkyyDtNfrmVL8ex+2Fzi2KZ0yayLAzVzsaIA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Q2NyCq6HwsUHDq2febOX5SpE1dfjMgUkht+44JJQVaoeE1/ERq4090GbCJQM1hhXV75WWugMLCPZduj2j1wp92Wr0XRd/0yCnv+DFhK8R9wOeGCd3JXVZgD/U0C6tRDHdZX68NOYrj5S5V2Op0EIAdY3oqJIAMwfMRzFCLj/ook= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=RnWlxeUx; 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="RnWlxeUx" Received: by smtp.kernel.org (Postfix) with ESMTPSA id F0DCC1F000E9; Thu, 30 Jul 2026 15:07:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1785424064; bh=hSPeOG7KFREJT2+4u6sAGKCBFtg++NIhOTmfYZx4rDg=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=RnWlxeUx4zyG7vkjALGupiTH5gKDyuErjgH56jcz5oE28B/vWyorJdfRhpdmIETxt kDJps1r0YN2q9P2IdJd7mSVvKmCEVBx1w0A0Beif88XSIGelxzcROKk2gng2eT3lIV pey9Zj4igct01Il6h66WUaO41xRvrB1DzQptvLi4= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Lorenzo Bianconi , Felix Fietkau , Sasha Levin Subject: [PATCH 6.18 261/675] wifi: mt76: connac: fix possible NULL-pointer deref in mt76_connac_mcu_uni_bss_he_tlv() Date: Thu, 30 Jul 2026 16:09:51 +0200 Message-ID: <20260730141450.683603931@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260730141445.110192266@linuxfoundation.org> References: <20260730141445.110192266@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 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Lorenzo Bianconi [ Upstream commit 2c1fb2335f5e3afb34f91bc07ecb63517c328090 ] mt76_connac_get_he_phy_cap routine can theoretically return NULL so check cap pointer before dereferencing it. Fixes: d0e274af2f2e4 ("mt76: mt76_connac: create mcu library") Signed-off-by: Lorenzo Bianconi Link: https://patch.msgid.link/20260621-mt76_connac_get_he_phy_cap-fix-v1-1-ed4ccf7a0363@kernel.org Signed-off-by: Felix Fietkau Signed-off-by: Sasha Levin --- drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c b/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c index fc3e6728fcfbfb..2aa7b711c774e0 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c @@ -1441,6 +1441,8 @@ mt76_connac_mcu_uni_bss_he_tlv(struct mt76_phy *phy, struct ieee80211_vif *vif, struct bss_info_uni_he *he; cap = mt76_connac_get_he_phy_cap(phy, vif); + if (!cap) + return; he = (struct bss_info_uni_he *)tlv; he->he_pe_duration = vif->bss_conf.htc_trig_based_pkt_ext; -- 2.53.0