From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from puleglot.ru (puleglot.ru [195.201.32.202]) (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 DBFD71A317D; Tue, 22 Apr 2025 12:02:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.201.32.202 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745323372; cv=none; b=t1Md6lMYPZLWdmrktGu1KPip+oDACEZHwD4UG42aFG3brWpwjW+3QIHYQKaKMF4AwrSd20SdQp1fUS6Io7LOzN4x/QCTvSNXx1x69SzZn+TS/r0lyky1YHym8f9323EF4Eea1hE7TzSB1iCpx6e9Y2mtNmJY0/ydF01eJHUyJac= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745323372; c=relaxed/simple; bh=Goxvk2nZBBnNqpJrUVgMtNX4+wcPMMkMqbLM5GioZfc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=kjRKl0oDVQE0bSuP482iH85/O6Y8/Ht7zMMtPsNprhlRszaZUh+FdLQj0r0ung3dHKwMAjyM+ydNszs0eAE5uH5nrBu9VGpJIkUSijNz+sgzb2gwd8Xx/4UXFkIlOPzZKLDCdi3M7cuslZ9et9sdmUCHPKf3dT39LOqE2L0TdE0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=tsoy.me; spf=pass smtp.mailfrom=puleglot.ru; dkim=pass (1024-bit key) header.d=tsoy.me header.i=@tsoy.me header.b=HlUfPPOu; arc=none smtp.client-ip=195.201.32.202 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=tsoy.me Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=puleglot.ru Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=tsoy.me header.i=@tsoy.me header.b="HlUfPPOu" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tsoy.me; s=mymail; h=Sender:Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=avd87UaFcn3ETwk6SNEagorvgBdsjVCSTbbht7iYtv8=; b=HlUfPPOu6x9U1ACsBdWPMyXFC9 78V4VP0nQjLSxUEWnVJrsLpuZzMfHnGNfXCpP74ANlzCVfC4rBom37gpV5iJBrEhqHFaJ3W/Ye/+t OZ4J/4URxFKnFrwey1iBTxHg6u/a7RuLzw0DbvLRtX8N3V6/cSuaM0ugUBfWQ2sjkmrQ=; Received: from [62.217.191.235] (helo=home.puleglot.ru) by puleglot.ru with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.97.1) (envelope-from ) id 1u7CKt-00000000Djl-1WkY; Tue, 22 Apr 2025 15:02:47 +0300 From: Alexander Tsoy To: Greg Kroah-Hartman , stable@vger.kernel.org Cc: patches@lists.linux.dev, P Praneesh , Jeff Johnson , Sasha Levin Subject: [PATCH 6.14.y v2 2/2] wifi: ath12k: Fix invalid entry fetch in ath12k_dp_mon_srng_process Date: Tue, 22 Apr 2025 15:02:37 +0300 Message-ID: <20250422120237.228960-2-alexander@tsoy.me> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250422120237.228960-1-alexander@tsoy.me> References: <20250422120237.228960-1-alexander@tsoy.me> Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: puleglot@puleglot.ru From: P Praneesh [ Upstream commit 63fdc4509bcf483e79548de6bc08bf3c8e504bb3 ] Currently, ath12k_dp_mon_srng_process uses ath12k_hal_srng_src_get_next_entry to fetch the next entry from the destination ring. This is incorrect because ath12k_hal_srng_src_get_next_entry is intended for source rings, not destination rings. This leads to invalid entry fetches, causing potential data corruption or crashes due to accessing incorrect memory locations. This happens because the source ring and destination ring have different handling mechanisms and using the wrong function results in incorrect pointer arithmetic and ring management. To fix this issue, replace the call to ath12k_hal_srng_src_get_next_entry with ath12k_hal_srng_dst_get_next_entry in ath12k_dp_mon_srng_process. This ensures that the correct function is used for fetching entries from the destination ring, preventing invalid memory accesses. Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-QCAHKSWPL_SILICONZ-1 Tested-on: WCN7850 hw2.0 WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3 Signed-off-by: P Praneesh Link: https://patch.msgid.link/20241223060132.3506372-7-quic_ppranees@quicinc.com Signed-off-by: Jeff Johnson Signed-off-by: Sasha Levin --- drivers/net/wireless/ath/ath12k/dp_mon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath12k/dp_mon.c b/drivers/net/wireless/ath/ath12k/dp_mon.c index 8005d30a4dbe..b952e79179d0 100644 --- a/drivers/net/wireless/ath/ath12k/dp_mon.c +++ b/drivers/net/wireless/ath/ath12k/dp_mon.c @@ -2054,7 +2054,7 @@ int ath12k_dp_mon_srng_process(struct ath12k *ar, int mac_id, int *budget, dest_idx = 0; move_next: ath12k_dp_mon_buf_replenish(ab, buf_ring, 1); - ath12k_hal_srng_src_get_next_entry(ab, srng); + ath12k_hal_srng_dst_get_next_entry(ab, srng); num_buffs_reaped++; } -- 2.49.0