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 B8BA2192594; Tue, 8 Oct 2024 12:43:58 +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=1728391438; cv=none; b=I0bInDkJDZ4rFh0jOkSatNGlAzIX7rKUuB2o5UaaV/2GDcFu6syclOPgV9xJ6pZpT7ByUjPv1gJ2W1WzvrYoaq8YgHG+//0m46p0YA9LakH6CVFDhPJTdtwOdVC3ARpnwG8KJmnOq4MyYrChZUk9D/kUo4V8AlVNrN8AlVco/fQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728391438; c=relaxed/simple; bh=guxe/386R9pwlvidbY1K+N16wFWiFH+lDP9IlomuJD4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=h3KxYEN++Mxhhi4dCLAqgD1teU2c+WnqQgrDK6USYREZieP7sLj/11Oz/luvnilEtcRJS8nP/1N5ypxctlU7QT+1mCzTX3zwNlQFY8hm0kU3vuoVZ0V1KMF/daBtTz9NiH6rpHAXIQ+0lLWjE1+WuHWGQ+Pq8RddAsCkSz9siPw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=nPPJMYzS; 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="nPPJMYzS" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2503FC4CEC7; Tue, 8 Oct 2024 12:43:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1728391438; bh=guxe/386R9pwlvidbY1K+N16wFWiFH+lDP9IlomuJD4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nPPJMYzSnYITFic+DiZCXcY0bCwJQUTvITGjOheUZux+cEWmasHZtJDYyzh5JcM/B EVFnnQHGhF3BvyK7L3Rvj97W4e48h9QeHofhgiX2PUyXBTkdmuxhanwGKrFOKsvmca 3LppQcCmeZW+JqyopA/iwbZwtNPRdRwN6wS+M3E8= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Karthikeyan Periyasamy , Kalle Valo , Sasha Levin Subject: [PATCH 6.11 115/558] wifi: ath11k: fix array out-of-bound access in SoC stats Date: Tue, 8 Oct 2024 14:02:25 +0200 Message-ID: <20241008115706.891645398@linuxfoundation.org> X-Mailer: git-send-email 2.46.2 In-Reply-To: <20241008115702.214071228@linuxfoundation.org> References: <20241008115702.214071228@linuxfoundation.org> User-Agent: quilt/0.67 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.11-stable review patch. If anyone has any objections, please let me know. ------------------ From: Karthikeyan Periyasamy [ Upstream commit 69f253e46af98af17e3efa3e5dfa72fcb7d1983d ] Currently, the ath11k_soc_dp_stats::hal_reo_error array is defined with a maximum size of DP_REO_DST_RING_MAX. However, the ath11k_dp_process_rx() function access ath11k_soc_dp_stats::hal_reo_error using the REO destination SRNG ring ID, which is incorrect. SRNG ring ID differ from normal ring ID, and this usage leads to out-of-bounds array access. To fix this issue, modify ath11k_dp_process_rx() to use the normal ring ID directly instead of the SRNG ring ID to avoid out-of-bounds array access. Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1 Signed-off-by: Karthikeyan Periyasamy Signed-off-by: Kalle Valo Link: https://patch.msgid.link/20240704070811.4186543-3-quic_periyasa@quicinc.com Signed-off-by: Sasha Levin --- drivers/net/wireless/ath/ath11k/dp_rx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath11k/dp_rx.c b/drivers/net/wireless/ath/ath11k/dp_rx.c index 86485580dd895..c087d8a0f5b25 100644 --- a/drivers/net/wireless/ath/ath11k/dp_rx.c +++ b/drivers/net/wireless/ath/ath11k/dp_rx.c @@ -2697,7 +2697,7 @@ int ath11k_dp_process_rx(struct ath11k_base *ab, int ring_id, if (unlikely(push_reason != HAL_REO_DEST_RING_PUSH_REASON_ROUTING_INSTRUCTION)) { dev_kfree_skb_any(msdu); - ab->soc_stats.hal_reo_error[dp->reo_dst_ring[ring_id].ring_id]++; + ab->soc_stats.hal_reo_error[ring_id]++; continue; } -- 2.43.0