drm/amd/display: Guard against invalid RPTR/WPTR being set
authorNicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Wed, 13 Sep 2023 20:18:44 +0000 (16:18 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 8 Dec 2023 07:51:19 +0000 (08:51 +0100)
commit195514bda626b16fb6ef9ff4172dc0433a3c105b
treea0a8b1dc5941f5d74843d6b1a7e59ca32a4d389f
parent395a63ca1ad2e0534176cac91f5715961e744529
drm/amd/display: Guard against invalid RPTR/WPTR being set

[ Upstream commit 1ffa8602e39b89469dc703ebab7a7e44c33da0f7 ]

[WHY]
HW can return invalid values on register read, guard against these being
set and causing us to access memory out of range and page fault.

[HOW]
Guard at sync_inbox1 and guard at pushing commands.

Cc: Mario Limonciello <mario.limonciello@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Reviewed-by: Hansen Dsouza <hansen.dsouza@amd.com>
Acked-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@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/dmub/src/dmub_srv.c