title: drivers/amd/pm: fix a use-after-free in kv_parse_power_table
description: In the Linux kernel, the following vulnerability has been resolved:
drivers/amd/pm: fix a use-after-free in kv_parse_power_table
When ps allocated by kzalloc equals to NULL, kv_parse_power_table
frees adev->pm.dpm.ps that allocated before. However, after the control
flow goes through the following call chains:
kv_parse_power_table
|-> kv_dpm_init
|-> kv_dpm_sw_init
|-> kv_dpm_fini
The adev->pm.dpm.ps is used in the for loop of kv_dpm_fini after its
first free in kv_parse_power_table and causes a use-after-free bug.
affected:
{
product: Linux
vendor: Linux
defaultStatus: unaffected
repo: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
versions:
version: a2e73f56fa62, lessThan: 8a27d9d9fc9b, status: affected, versionType: git
version: a2e73f56fa62, lessThan: 8b55b06e737f, status: affected, versionType: git
version: a2e73f56fa62, lessThan: 520e213a0b97, status: affected, versionType: git
version: a2e73f56fa62, lessThan: b6dcba02ee17, status: affected, versionType: git
version: a2e73f56fa62, lessThan: 35fa2394d26e, status: affected, versionType: git
version: a2e73f56fa62, lessThan: 95084632a65d, status: affected, versionType: git
version: a2e73f56fa62, lessThan: 3426f059eacc, status: affected, versionType: git
version: a2e73f56fa62, lessThan: 28dd788382c4, status: affected, versionType: git
}
{
product: Linux
vendor: Linux
defaultStatus: affected
repo: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
versions:
version: 4.2, status: affected
version: 0, lessThan: 4.2, status: unaffected, versionType: custom
version: 4.19.306, lessThanOrEqual: 4.19.*, status: unaffected, versionType: custom
version: 5.4.268, lessThanOrEqual: 5.4.*, status: unaffected, versionType: custom
version: 5.10.209, lessThanOrEqual: 5.10.*, status: unaffected, versionType: custom
version: 5.15.148, lessThanOrEqual: 5.15.*, status: unaffected, versionType: custom
version: 6.1.75, lessThanOrEqual: 6.1.*, status: unaffected, versionType: custom
version: 6.6.14, lessThanOrEqual: 6.6.*, status: unaffected, versionType: custom
version: 6.7.2, lessThanOrEqual: 6.7.*, status: unaffected, versionType: custom
version: 6.8, lessThanOrEqual: *, status: unaffected, versionType: original_commit_for_fix
}
