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 1D29F217704; Sat, 30 May 2026 18:21:37 +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=1780165298; cv=none; b=sYExA8cgsyOBoCS5ZAF464SeYYty/b3pO/4A8ce4o1Ze2R9JwKQmquJbZIk/fLVAyUif6MHOHj+e7rpx9aDJsbs3ng2UhMG50Vix9zVxT/iYKvGT5MP4GYU3GqM8DoxBG1Q3XTZQOYEnXRoXEQb5th8Y9g1a03RdRyEKBcZN9lY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780165298; c=relaxed/simple; bh=atPz0NoVJJZ8AFws/n6j89qQTHagxtr3vZ+bwn96MaU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=HTubf3IHVg7eo9CmMA08+gph+3ktPTeYBy3usUPYHCukveKgu2NNDltqX8rt5MNWJHZNkvsQOpLuWBQUwABC6cGqywi3jqMAOSL6KcIPUvHmyl+1A7u3Uf/ELG2NMfSCI0NP5V5ZRuKV5O2QCehZmQ/84PGPs8mDR0lkh4e2cDA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=V2Hz5AtZ; 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="V2Hz5AtZ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 350601F00893; Sat, 30 May 2026 18:21:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1780165296; bh=Qg1WdKo0tz0iDevGEbZDqQjQJ8u+y+mzYPrja28Cz4Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=V2Hz5AtZ/Maw/gR0JIXGriTeNShMJTDgC2cLViJ5Y7jHPd4T+O8u4nw84UlwQdUjB Tla5MErDbQwrw39G58rgnxZRbffSgyrHFORBQ9PpE0n6gLKilrRJs2ieTVFVLoOrcp yks8HqBthqn8FtGHPB5qIfNLTdsDGwOt1fbQApls= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Pengpeng Hou , Johannes Berg , Sasha Levin Subject: [PATCH 5.10 007/589] wifi: wl1251: validate packet IDs before indexing tx_frames Date: Sat, 30 May 2026 17:58:08 +0200 Message-ID: <20260530160224.770915821@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260530160224.570625122@linuxfoundation.org> References: <20260530160224.570625122@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 5.10-stable review patch. If anyone has any objections, please let me know. ------------------ From: Pengpeng Hou [ Upstream commit 0fd56fad9c56356e7fa7a7c52e7ecbf807a44eb0 ] wl1251_tx_packet_cb() uses the firmware completion ID directly to index the fixed 16-entry wl->tx_frames[] array. The ID is a raw u8 from the completion block, and the callback does not currently verify that it fits the array before dereferencing it. Reject completion IDs that fall outside wl->tx_frames[] and keep the existing NULL check in the same guard. This keeps the fix local to the trust boundary and avoids touching the rest of the completion flow. Signed-off-by: Pengpeng Hou Link: https://patch.msgid.link/20260323080845.40033-1-pengpeng@iscas.ac.cn Signed-off-by: Johannes Berg Signed-off-by: Sasha Levin --- drivers/net/wireless/ti/wl1251/tx.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/ti/wl1251/tx.c b/drivers/net/wireless/ti/wl1251/tx.c index 5771f61392efb..7f406c086ca56 100644 --- a/drivers/net/wireless/ti/wl1251/tx.c +++ b/drivers/net/wireless/ti/wl1251/tx.c @@ -402,12 +402,14 @@ static void wl1251_tx_packet_cb(struct wl1251 *wl, int hdrlen; u8 *frame; - skb = wl->tx_frames[result->id]; - if (skb == NULL) { - wl1251_error("SKB for packet %d is NULL", result->id); + if (unlikely(result->id >= ARRAY_SIZE(wl->tx_frames) || + wl->tx_frames[result->id] == NULL)) { + wl1251_error("invalid packet id %u", result->id); return; } + skb = wl->tx_frames[result->id]; + info = IEEE80211_SKB_CB(skb); if (!(info->flags & IEEE80211_TX_CTL_NO_ACK) && -- 2.53.0