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 A2E70372EF6; Wed, 20 May 2026 16:30:08 +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=1779294609; cv=none; b=JppPMPmQK4LY7NeVOIb0ukMTt7Zk5kYXiM1uCQ7cpQ2Q5MQ+mCbopE8C0SJFIGMj9+Qp/M9Dj4ehxze9Mw8z5BaCdDo75JUCmVHyIjoqwiqHbODBJiA0cAMk4Ud1RtCJ9ISEj135y4eucSsCFNuhiW/9eibNM2BF50Qs1a4+NbI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779294609; c=relaxed/simple; bh=HVBuOXe9BegCGm2HXvGi+MwvYQwTefeytpY5sWToCL0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=n7O2s7X0ho1XGc8ZFXwGzBXYvb8OEpZTHKH7qXsBMhdq6iUdNtbm3TONKLqv6mIh53v/wkYXyTwvpkb4HL9KS6DHIic8JBFHYBMK5rcD6zIY6LfJ/eh2pczgKJfb4qdyC8+Vh3+TGR5D5LWmKT3A4tGnulN0aD8o18QRiGeSS1s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=IkhWRS11; 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="IkhWRS11" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 07B4F1F000E9; Wed, 20 May 2026 16:30:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1779294608; bh=5jMzBFhObh6TAGBz8DXQtw2yVaRWCsm0a3hzda0OqJc=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=IkhWRS11Rj/nw0ok2gfykCiE4keSh8zhTLloP72R+GXcMYdNk8f5jZcJLaeITaNcM BdFNj8w+ACbsrB3OxXR3GhBZsjUaop6VvQIQ1QM220dXfe75q8W/RiQHbmXt91hmAI 0XlInUqsT8HHSnZTIRKlSWdtnnH2MZIVWGp2sfg4= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Ming Yen Hsieh , Felix Fietkau , Sasha Levin Subject: [PATCH 7.0 0104/1146] wifi: mt76: mt7925: prevent NULL pointer dereference in mt7925_tx_check_aggr() Date: Wed, 20 May 2026 18:05:54 +0200 Message-ID: <20260520162150.695254727@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260520162148.390695140@linuxfoundation.org> References: <20260520162148.390695140@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.0-stable review patch. If anyone has any objections, please let me know. ------------------ From: Ming Yen Hsieh [ Upstream commit 83ae3a18ba957257b4c406273d2da2caeea2b439 ] Move the NULL check for 'sta' before dereferencing it to prevent a possible crash. Fixes: 44eb173bdd4f ("wifi: mt76: mt7925: add link handling in mt7925_txwi_free") Signed-off-by: Ming Yen Hsieh Link: https://patch.msgid.link/20250904030649.655436-4-mingyen.hsieh@mediatek.com Signed-off-by: Felix Fietkau Signed-off-by: Sasha Levin --- drivers/net/wireless/mediatek/mt76/mt7925/mac.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/mac.c b/drivers/net/wireless/mediatek/mt76/mt7925/mac.c index ebe872f58c88f..711daa5f07fab 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7925/mac.c +++ b/drivers/net/wireless/mediatek/mt76/mt7925/mac.c @@ -846,11 +846,14 @@ static void mt7925_tx_check_aggr(struct ieee80211_sta *sta, struct sk_buff *skb, bool is_8023; u16 fc, tid; + if (!sta) + return; + link_sta = rcu_dereference(sta->link[wcid->link_id]); if (!link_sta) return; - if (!sta || !(link_sta->ht_cap.ht_supported || link_sta->he_cap.has_he)) + if (!(link_sta->ht_cap.ht_supported || link_sta->he_cap.has_he)) return; tid = skb->priority & IEEE80211_QOS_CTL_TID_MASK; -- 2.53.0