OSDN Git Service

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 16:52:40 +0000 (11:52 -0500)
commita5d313b4165ca08686d5d41ee08b0a8cab2737ca
treec3ae20a3bcf41c4e44be3776a54e98630dcf652d
parentbe590ba8e2db4f82c07936af02541c7fea1a16d2
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