From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 15F7F179A3; Fri, 24 Apr 2026 13:35:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777037714; cv=none; b=Xq4iTgXfKcuxUxpBLFhiNBmUZaFsnDuZwwXxNKdiWms58BS8JhUgK8nBNUpmgIs0B0xVNEcR/UMCKVnGCHmKrrNJG+Hei4LuwLJKsjUSh+rp6SjHGZUSg/Ss1C3+SZy1mB6jPUPBQy7cN39uTlxw16rQVP5bCJIJSX7665B+TIA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777037714; c=relaxed/simple; bh=G3hPNXMau6vNdh2wYiAv3fQnXiFf9DJUhK5cu3Ce0v4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=LBYIALjV9R4qQnNd+mY5+v+x7M89HkMnmLZVQHtA+TZ2JsFsf4zOil99iTwABF02rfHno9TW7ogA7SpokaanB3qqwlkUsA4gdq0vwwMurl7gz+MTqV7sETkmVKFbukUdJMh7VGvy/C3WufmnI6AoamPXwG0lUjNT2seH2Bf7AXk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=BiH/NMoC; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="BiH/NMoC" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A061AC19425; Fri, 24 Apr 2026 13:35:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1777037714; bh=G3hPNXMau6vNdh2wYiAv3fQnXiFf9DJUhK5cu3Ce0v4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BiH/NMoCl4GBacbUVGIVdiAiWBCHZr3EMQ/hFM4WiJ4vxBLB+yo59NNHIJObNKgto lWDD9uzH2J/BkiMaSIrU4p5Fv6JzkkwukYqnzgxUemYcDh4Kjm9oiy1J9eVF7TYa2L DeI5otKu4WbBsJeLHLo4Krw0SCn1oMD3KFUDx1B8= 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 6.6 014/166] wifi: wl1251: validate packet IDs before indexing tx_frames Date: Fri, 24 Apr 2026 15:28:48 +0200 Message-ID: <20260424132535.863271591@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260424132532.812258529@linuxfoundation.org> References: <20260424132532.812258529@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-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 06dc74cc6cb52..2b316c78eefc9 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