[PATCH] drm/amd/display: Check msg->size before starting aux transfer

Harry Wentland harry.wentland at amd.com
Tue Mar 13 14:12:05 UTC 2018


On 2018-03-13 02:28 AM, Shirish S wrote:
> This patch adds an essential check related to the size of the
> payload to be transferred via aux channel.
> 
> Without this check dal_ddc_service_read_dpcd_data() is fed with
> inappropriate payload size leading to deadlocks.
> 
> Signed-off-by: Shirish S <shirish.s at amd.com>

Reviewed-by: Harry Wentland <harry.wentland at amd.com>

Harry

> ---
>  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
> index 39cfe0f..8291d74 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
> @@ -85,6 +85,9 @@ static ssize_t dm_dp_aux_transfer(struct drm_dp_aux *aux,
>  	enum ddc_result res;
>  	ssize_t read_bytes;
>  
> +	if (WARN_ON(msg->size > 16))
> +		return -E2BIG;
> +
>  	switch (msg->request & ~DP_AUX_I2C_MOT) {
>  	case DP_AUX_NATIVE_READ:
>  		read_bytes = dal_ddc_service_read_dpcd_data(
> 


More information about the amd-gfx mailing list