Skip to content

Commit 2f2d48b

Browse files
Lin.Caogregkh
authored andcommitted
drm/amd: check num of link levels when update pcie param
commit 406e8845356d18bdf3d3a23b347faf67706472ec upstream. In SR-IOV environment, the value of pcie_table->num_of_link_levels will be 0, and num_of_levels - 1 will cause array index out of bounds Signed-off-by: Lin.Cao <[email protected]> Acked-by: Jingwen Chen <[email protected]> Signed-off-by: Alex Deucher <[email protected]> [ Resolve minor conflicts to fix CVE-2023-52812 ] Signed-off-by: Bin Lan <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 52c81fd commit 2f2d48b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2498,6 +2498,9 @@ int smu_v13_0_update_pcie_parameters(struct smu_context *smu,
24982498
uint32_t smu_pcie_arg;
24992499
int ret, i;
25002500

2501+
if (!num_of_levels)
2502+
return 0;
2503+
25012504
if (!amdgpu_device_pcie_dynamic_switching_supported()) {
25022505
if (pcie_table->pcie_gen[num_of_levels - 1] < pcie_gen_cap)
25032506
pcie_gen_cap = pcie_table->pcie_gen[num_of_levels - 1];

0 commit comments

Comments
 (0)