]> git.hungrycats.org Git - linux/commit
drm/amd/display: Fix array-index-out-of-bounds in dml2/FCLKChangeSupport
authorRoman Li <Roman.Li@amd.com>
Wed, 26 Jun 2024 18:08:41 +0000 (14:08 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Jul 2024 07:53:38 +0000 (09:53 +0200)
commit94166fe12543fbef122ca2d093e794ea41073a85
tree63860ea2a5b26d68df495b561985a785511ecaa0
parent823273bf78434a6e89545317cfd767183e6f02ea
drm/amd/display: Fix array-index-out-of-bounds in dml2/FCLKChangeSupport

[ Upstream commit 0ad4b4a2f6357c45fbe444ead1a929a0b4017d03 ]

[Why]
Potential out of bounds access in dml2_calculate_rq_and_dlg_params()
because the value of out_lowest_state_idx used as an index for FCLKChangeSupport
array can be greater than 1.

[How]
Currently dml2 core specifies identical values for all FCLKChangeSupport
elements. Always use index 0 in the condition to avoid out of bounds access.

Acked-by: Rodrigo Siqueira <rodrigo.siqueira@amd.com>
Signed-off-by: Jerry Zuo <jerry.zuo@amd.com>
Signed-off-by: Roman Li <Roman.Li@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/amd/display/dc/dml2/dml2_utils.c