答复: [PATCH] drm/amdgpu: use proper index in smu_v13_0_7_get_power_profile_mode()

Feng, Kenneth Kenneth.Feng at amd.com
Sat May 7 01:35:14 UTC 2022


[AMD Official Use Only - General]

Reviewed-by: Kenneth Feng <kenneth.feng at amd.com<mailto:kenneth.feng at amd.com>>

Best wishes
Kenneth Feng


发件人: Deucher, Alexander <Alexander.Deucher at amd.com>
日期: 星期五, 2022年5月6日 22:07
收件人: amd-gfx at lists.freedesktop.org <amd-gfx at lists.freedesktop.org>
抄送: Deucher, Alexander <Alexander.Deucher at amd.com>, Feng, Kenneth <Kenneth.Feng at amd.com>, Stephen Rothwell <sfr at canb.auug.org.au>
主题: [PATCH] drm/amdgpu: use proper index in smu_v13_0_7_get_power_profile_mode()
Otherwise we get an out of bounds access.

Fixes: 878205b8c170 ("drm/amd/pm: enable workload type change on smu_v13_0_7")
Signed-off-by: Alex Deucher <alexander.deucher at amd.com>
Cc: Kenneth Feng <kenneth.feng at amd.com>
Cc: Stephen Rothwell <sfr at canb.auug.org.au>
---
 drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c
index 8e576054bee5..cf5800822174 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c
@@ -1361,7 +1361,7 @@ static int smu_v13_0_7_get_power_profile_mode(struct smu_context *smu, char *buf
 do {                                                                                                    \
         size += sysfs_emit_at(buf, size, "%-30s", #field);                                              \
         for (j = 0; j <= PP_SMC_POWER_PROFILE_WINDOW3D; j++)                                            \
-               size += sysfs_emit_at(buf, size, "%-16d", activity_monitor_external[i].DpmActivityMonitorCoeffInt.field);               \
+               size += sysfs_emit_at(buf, size, "%-16d", activity_monitor_external[j].DpmActivityMonitorCoeffInt.field);               \
         size += sysfs_emit_at(buf, size, "\n");                                                         \
 } while (0)

--
2.35.1
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/amd-gfx/attachments/20220507/47f394cc/attachment-0001.htm>


More information about the amd-gfx mailing list