Skip to content

Commit 3b76382

Browse files
committed
drm/radeon: fix UBSAN warning in kv_dpm.c
jira LE-3201 cve CVE-2024-40988 Rebuild_History Non-Buildable kernel-rt-4.18.0-553.22.1.rt7.363.el8_10 commit-author Alex Deucher <alexander.deucher@amd.com> commit 9717345 Adds bounds check for sumo_vid_mapping_entry. Reviewed-by: Mario Limonciello <mario.limonciello@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> (cherry picked from commit 9717345) Signed-off-by: Jonathan Maple <jmaple@ciq.com>
1 parent 9fc9075 commit 3b76382

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/gpu/drm/radeon/sumo_dpm.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1619,6 +1619,8 @@ void sumo_construct_vid_mapping_table(struct radeon_device *rdev,
16191619

16201620
for (i = 0; i < SUMO_MAX_HARDWARE_POWERLEVELS; i++) {
16211621
if (table[i].ulSupportedSCLK != 0) {
1622+
if (table[i].usVoltageIndex >= SUMO_MAX_NUMBER_VOLTAGES)
1623+
continue;
16221624
vid_mapping_table->entries[table[i].usVoltageIndex].vid_7bit =
16231625
table[i].usVoltageID;
16241626
vid_mapping_table->entries[table[i].usVoltageIndex].vid_2bit =

0 commit comments

Comments
 (0)