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 C7EA33AD539; Mon, 23 Mar 2026 13:55:18 +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=1774274118; cv=none; b=K/otp9/IPlHAd9+LGCEi4OdM2nrXn/P3UzNDZeRv+wMOObJPxis9LIv0a9wt9jCtUQLzCY8nZG+iZDgei85qeT/nkJrQG4pHV5eAe87ONbc5uMkqAVoPVkx1l03HpmqQny0rCDPNeZE8UWvtUh+oIiODgXOGEa2zpP4Rf3YNFmE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774274118; c=relaxed/simple; bh=h4I1v08ry+Re/P8YpzGZyDnhfih+NKkNBR25Pm1HVAQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Em7Q4KgY8VkPZRDMxVf10uVkrqdGQ1BkR6SxaN+qeXTfL6wPWJKN+y+YxA57DZ6s7V2DOYhJUI9Ouoig79r1YFivqHCKg4oEpfM+mUrbj2p1rgQK+2eIWJvrcQehd+9mJPMH8fdFYa/9SvzPl8xY7plPvEYoGa+9Fbd28akC8kA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=a30IPtIA; 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="a30IPtIA" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4B92CC4CEF7; Mon, 23 Mar 2026 13:55:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1774274118; bh=h4I1v08ry+Re/P8YpzGZyDnhfih+NKkNBR25Pm1HVAQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=a30IPtIAGZSFMECqL4b+e45F08YDj7v2QNJu65cifMRFIhH0PZQBtFd6q8gjmo3u7 V2H0gwpfItsVWroFGOBaUFdrliWJ7C59uOhhiOUZyAXV5xskZCEeUMex9m9CK6Npbu l6R1/GYeAHF/so8GGWZCG++TY08HS6u9hLm+DGco= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Benjamin Cheng , Alex Deucher Subject: [PATCH 6.19 078/220] drm/amdgpu/mmhub3.0: add bounds checking for cid Date: Mon, 23 Mar 2026 14:44:15 +0100 Message-ID: <20260323134507.061915722@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260323134504.575022936@linuxfoundation.org> References: <20260323134504.575022936@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.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: Alex Deucher commit cdb82ecbeccb55fae75a3c956b605f7801a30db1 upstream. The value should never exceed the array size as those are the only values the hardware is expected to return, but add checks anyway. Reviewed-by: Benjamin Cheng Signed-off-by: Alex Deucher (cherry picked from commit f14f27bbe2a3ed7af32d5f6eaf3f417139f45253) Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/amd/amdgpu/mmhub_v3_0.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/drivers/gpu/drm/amd/amdgpu/mmhub_v3_0.c +++ b/drivers/gpu/drm/amd/amdgpu/mmhub_v3_0.c @@ -110,7 +110,8 @@ mmhub_v3_0_print_l2_protection_fault_sta switch (amdgpu_ip_version(adev, MMHUB_HWIP, 0)) { case IP_VERSION(3, 0, 0): case IP_VERSION(3, 0, 1): - mmhub_cid = mmhub_client_ids_v3_0_0[cid][rw]; + mmhub_cid = cid < ARRAY_SIZE(mmhub_client_ids_v3_0_0) ? + mmhub_client_ids_v3_0_0[cid][rw] : NULL; break; default: mmhub_cid = NULL;