Commit 5d10e581 authored by Zhipeng Lu's avatar Zhipeng Lu Committed by Xia Fukun
Browse files

drm/amd/pm: fix a double-free in si_dpm_init

stable inclusion
from stable-v4.19.314
commit afe9f5b871f86d58ecdc45b217b662227d7890d0
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/I9Q9IJ
CVE: CVE-2023-52691

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-4.19.y&id=afe9f5b871f86d58ecdc45b217b662227d7890d0



--------------------------------

[ Upstream commit ac16667237a82e2597e329eb9bc520d1cf9dff30 ]

When the allocation of
adev->pm.dpm.dyn_state.vddc_dependency_on_dispclk.entries fails,
amdgpu_free_extended_power_table is called to free some fields of adev.
However, when the control flow returns to si_dpm_sw_init, it goes to
label dpm_failed and calls si_dpm_fini, which calls
amdgpu_free_extended_power_table again and free those fields again. Thus
a double-free is triggered.

Fixes: 841686df ("drm/amdgpu: add SI DPM support (v4)")
Signed-off-by: default avatarZhipeng Lu <alexious@zju.edu.cn>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarXia Fukun <xiafukun@huawei.com>
parent 5bab8a92
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment