summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/bin
diff options
context:
space:
mode:
authorHari Mishal <harimishal1@gmail.com>2026-09-14 15:29:20 +0200
committerAlex Deucher <alexander.deucher@amd.com>2026-09-17 11:38:28 -0400
commitf35aa5c77f5fca20fc269d6221df19c7b96704a5 (patch)
treec815d58dc50e107b4bd41219b7a9248974475ddb /tools/perf/scripts/python/bin
parentb2adbdf861e35a8e774f98b3c46dfa9e8dff9196 (diff)
downloadlinux-f35aa5c77f5fca20fc269d6221df19c7b96704a5.tar.gz
linux-f35aa5c77f5fca20fc269d6221df19c7b96704a5.zip
drm/amd/pm: bound SCLK FCW range entries to the table size
atomctrl_get_smc_sclk_range_table() copies ucSclkEntryNum entries from the VBIOS SMU_Info table into pp_atom_ctrl_sclk_range_table. Both the source (asSclkFcwRangeEntry[]) and destination (table->entry[]) arrays are fixed at MAX_SCLK_RANGE (8) entries, but ucSclkEntryNum is an unchecked u8 read straight from the VBIOS, so it can be up to 255. The destination is stack-allocated in both callers (polaris10_get_sclk_range_table(), vegam_get_sclk_range_table()), so a count above 8 overflows a stack buffer, not just a heap read. Reject counts above MAX_SCLK_RANGE rather than clamping to it. Only one version of this VBIOS struct (ATOM_SMU_INFO_V2_1) has ever existed, so a count above 8 corresponds to no legitimate table format and means either a corrupted or a tampered VBIOS. Fixes: a23eefa2f461 ("drm/amd/powerplay: enable dpm for baffin.") Assisted-by: gkh_clanker_t1000 Signed-off-by: Hari Mishal <harimishal1@gmail.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'tools/perf/scripts/python/bin')
0 files changed, 0 insertions, 0 deletions