]> git.baikalelectronics.ru Git - kernel.git/commit
drm/amd/display: Fix invalid DPIA AUX reply causing system hang
authorStylon Wang <stylon.wang@amd.com>
Wed, 26 Oct 2022 13:00:40 +0000 (21:00 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 15 Nov 2022 18:10:38 +0000 (13:10 -0500)
commit6f668793109f145a67ca0a5f494c5a6747802f62
tree8848738fd98d351602cee305163e53625b7c7b44
parentfb9a673afa4c91ef495610e5b6d6410358a73079
drm/amd/display: Fix invalid DPIA AUX reply causing system hang

[Why]
Some DPIA AUX replies have incorrect data length from original request.
This could lead to overwriting of destination buffer if reply length is
larger, which could cause invalid access to stack since many destination
buffers are declared as local variables.

[How]
Check for invalid length from DPIA AUX replies and trigger a retry if
reply length is not the same as original request. A DRM_WARN() dmesg log
is also produced.

Reviewed-by: Roman Li <Roman.Li@amd.com>
Acked-by: Tom Chung <chiahsuan.chung@amd.com>
Signed-off-by: Stylon Wang <stylon.wang@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org # 6.0.x
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h