]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
Fixes for 4.19
authorSasha Levin <sashal@kernel.org>
Thu, 27 Jun 2024 18:51:44 +0000 (14:51 -0400)
committerSasha Levin <sashal@kernel.org>
Thu, 27 Jun 2024 18:51:44 +0000 (14:51 -0400)
Signed-off-by: Sasha Levin <sashal@kernel.org>
queue-4.19/drm-amdgpu-fix-ubsan-warning-in-kv_dpm.c.patch [new file with mode: 0644]
queue-4.19/series

diff --git a/queue-4.19/drm-amdgpu-fix-ubsan-warning-in-kv_dpm.c.patch b/queue-4.19/drm-amdgpu-fix-ubsan-warning-in-kv_dpm.c.patch
new file mode 100644 (file)
index 0000000..b7529bd
--- /dev/null
@@ -0,0 +1,36 @@
+From 7113d17e9256dd65a6b7f16e635e0efd52f70c7e Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 20 May 2024 09:05:21 -0400
+Subject: drm/amdgpu: fix UBSAN warning in kv_dpm.c
+
+From: Alex Deucher <alexander.deucher@amd.com>
+
+[ Upstream commit f0d576f840153392d04b2d52cf3adab8f62e8cb6 ]
+
+Adds bounds check for sumo_vid_mapping_entry.
+
+Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/3392
+Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+Cc: stable@vger.kernel.org
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/gpu/drm/amd/amdgpu/kv_dpm.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/drivers/gpu/drm/amd/amdgpu/kv_dpm.c b/drivers/gpu/drm/amd/amdgpu/kv_dpm.c
+index 91a1628cd48fc..77a8d94b8ac76 100644
+--- a/drivers/gpu/drm/amd/amdgpu/kv_dpm.c
++++ b/drivers/gpu/drm/amd/amdgpu/kv_dpm.c
+@@ -164,6 +164,8 @@ static void sumo_construct_vid_mapping_table(struct amdgpu_device *adev,
+       for (i = 0; i < SUMO_MAX_HARDWARE_POWERLEVELS; i++) {
+               if (table[i].ulSupportedSCLK != 0) {
++                      if (table[i].usVoltageIndex >= SUMO_MAX_NUMBER_VOLTAGES)
++                              continue;
+                       vid_mapping_table->entries[table[i].usVoltageIndex].vid_7bit =
+                               table[i].usVoltageID;
+                       vid_mapping_table->entries[table[i].usVoltageIndex].vid_2bit =
+-- 
+2.43.0
+
index 5f8dff9921ed62cebd9728283a5bf7c6cba81632..11671c5a2f58bc5eb62d447e78b14c73ab34c1b3 100644 (file)
@@ -108,3 +108,4 @@ pinctrl-fix-deadlock-in-create_pinctrl-when-handling.patch
 pinctrl-rockchip-fix-pinmux-bits-for-rk3328-gpio2-b-.patch
 pinctrl-rockchip-fix-pinmux-bits-for-rk3328-gpio3-b-.patch
 pinctrl-rockchip-fix-pinmux-reset-in-rockchip_pmx_se.patch
+drm-amdgpu-fix-ubsan-warning-in-kv_dpm.c.patch