Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amdgpu: fix out of bounds access in gfx11 during ip dump

During ip dump in gfx11 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>

authored by

Sunil Khatri and committed by
Alex Deucher
ea67deb0 94845ea0

+2
+2
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c
··· 6411 6411 if (!adev->gfx.ip_dump_gfx_queues) 6412 6412 return; 6413 6413 6414 + index = 0; 6414 6415 reg_count = ARRAY_SIZE(gc_gfx_queue_reg_list_11); 6415 6416 drm_printf(p, "\nnum_me: %d num_pipe: %d num_queue: %d\n", 6416 6417 adev->gfx.me.num_me, ··· 6476 6475 if (!adev->gfx.ip_dump_gfx_queues) 6477 6476 return; 6478 6477 6478 + index = 0; 6479 6479 reg_count = ARRAY_SIZE(gc_gfx_queue_reg_list_11); 6480 6480 amdgpu_gfx_off_ctrl(adev, false); 6481 6481 mutex_lock(&adev->srbm_mutex);