]> git.baikalelectronics.ru Git - kernel.git/commit
drm/amd: Fix an out of bounds error in BIOS parser
authorMario Limonciello <mario.limonciello@amd.com>
Thu, 23 Mar 2023 19:07:06 +0000 (14:07 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 24 May 2023 16:32:36 +0000 (17:32 +0100)
commit184d90abec6e88b036732103a3ca8f5960b3dec9
tree095189302797edfeee4eed3b3a6d7f04e89d798f
parent03e295ade7e34ff628c2433cd711da7b501103a3
drm/amd: Fix an out of bounds error in BIOS parser

[ Upstream commit d116db180decec1b21bba31d2ff495ac4d8e1b83 ]

The array is hardcoded to 8 in atomfirmware.h, but firmware provides
a bigger one sometimes. Deferencing the larger array causes an out
of bounds error.

commit 4fc1ba4aa589 ("drm/amd/display: fix array index out of bound error
in bios parser") fixed some of this, but there are two other cases
not covered by it.  Fix those as well.

Reported-by: erhard_f@mailbox.org
Link: https://bugzilla.kernel.org/show_bug.cgi?id=214853
Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2473
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Reviewed-by: Harry Wentland <harry.wentland@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/bios/bios_parser2.c