]> git.baikalelectronics.ru Git - kernel.git/commit
amdgpu/pm: prevent array underflow in vega20_odn_edit_dpm_table()
authorDan Carpenter <error27@gmail.com>
Tue, 15 Nov 2022 12:56:57 +0000 (15:56 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Jan 2023 10:41:03 +0000 (11:41 +0100)
commit928adbb16c26d472a40f28383c33d861277104cd
tree5904399df08fcfa462332d62959fbf98f922942c
parent0d89678e5561232679420649e5501d82d828f975
amdgpu/pm: prevent array underflow in vega20_odn_edit_dpm_table()

[ Upstream commit 19b2c12f1d46f1a916c24203eb5a50502d4fbdd3 ]

In the PP_OD_EDIT_VDDC_CURVE case the "input_index" variable is capped at
2 but not checked for negative values so it results in an out of bounds
read.  This value comes from the user via sysfs.

Fixes: ae86668233a0 ("drm/amd/powerplay: added vega20 overdrive support V3")
Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c