summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/amdgpu
diff options
context:
space:
mode:
authorSunil Khatri <sunil.khatri@amd.com>2024-07-02 11:16:50 +0300
committerAlex Deucher <alexander.deucher@amd.com>2024-07-03 01:04:49 +0300
commit425c4a6f8ba62f77669a6a10ce9678153dee3e03 (patch)
tree0dcd2f2a0a575c86423ab471b9f508e4168d29f8 /drivers/gpu/drm/amd/amdgpu
parente931ab3eea505535abd0369c5da27e3a5d0057bb (diff)
downloadlinux-425c4a6f8ba62f77669a6a10ce9678153dee3e03.tar.xz
drm/amdgpu: fix out of bounds access in gfx10 during ip dump
During ip dump in gfx10 the index variable is reused but is not reinitialized to 0 and this causes the index calculation to be wrong and access out of bound access. Acked-by: Christian König <christian.koenig@amd.com> Signed-off-by: Sunil Khatri <sunil.khatri@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
index 18488c02d1cf..a52c72739b40 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
@@ -9287,6 +9287,7 @@ static void gfx_v10_ip_print(void *handle, struct drm_printer *p)
if (!adev->gfx.ip_dump_gfx_queues)
return;
+ index = 0;
reg_count = ARRAY_SIZE(gc_gfx_queue_reg_list_10);
drm_printf(p, "\nnum_me: %d num_pipe: %d num_queue: %d\n",
adev->gfx.me.num_me,
@@ -9352,6 +9353,7 @@ static void gfx_v10_ip_dump(void *handle)
if (!adev->gfx.ip_dump_gfx_queues)
return;
+ index = 0;
reg_count = ARRAY_SIZE(gc_gfx_queue_reg_list_10);
amdgpu_gfx_off_ctrl(adev, false);
mutex_lock(&adev->srbm_mutex);