[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CADnq5_MT3Ci94jytrXWM_WJaMU7BpzQHMhJnPb-hgUhU6JDa1w@mail.gmail.com>
Date: Wed, 22 Dec 2021 09:36:02 -0500
From: Alex Deucher <alexdeucher@...il.com>
To: Yizhuo Zhai <yzhai003@....edu>
Cc: David Airlie <airlied@...ux.ie>,
Rodrigo Siqueira <Rodrigo.Siqueira@....com>,
Maling list - DRI developers
<dri-devel@...ts.freedesktop.org>,
Meenakshikumar Somasundaram <meenakshikumar.somasundaram@....com>,
Jun Lei <jun.lei@....com>, Anthony Koo <Anthony.Koo@....com>,
Jimmy Kizito <Jimmy.Kizito@....com>,
Wenjing Liu <wenjing.liu@....com>,
amd-gfx list <amd-gfx@...ts.freedesktop.org>,
Fangzhi Zuo <Jerry.Zuo@....com>,
Aurabindo Pillai <aurabindo.pillai@....com>,
"Guo, Bing" <Bing.Guo@....com>, Leo Li <sunpeng.li@....com>,
Agustin Gutierrez <agustin.gutierrez@....com>,
Mark Morra <MarkAlbert.Morra@....com>,
Robin Singh <robin.singh@....com>,
"Pan, Xinhui" <Xinhui.Pan@....com>,
LKML <linux-kernel@...r.kernel.org>,
"for 3.8" <stable@...r.kernel.org>,
Christian König <christian.koenig@....com>,
Alex Deucher <alexander.deucher@....com>,
Nicholas Kazlauskas <nicholas.kazlauskas@....com>
Subject: Re: [PATCH] drm/amd/display: Fix the uninitialized variable in enable_stream_features()
Applied. Thanks!
Alex
On Fri, Dec 17, 2021 at 11:22 PM Yizhuo Zhai <yzhai003@....edu> wrote:
>
> In function enable_stream_features(), the variable "old_downspread.raw"
> could be uninitialized if core_link_read_dpcd() fails, however, it is
> used in the later if statement, and further, core_link_write_dpcd()
> may write random value, which is potentially unsafe.
>
> Fixes: 6016cd9dba0f ("drm/amd/display: add helper for enabling mst stream features")
> Cc: stable@...r.kernel.org
> Signed-off-by: Yizhuo Zhai <yzhai003@....edu>
> ---
> drivers/gpu/drm/amd/display/dc/core/dc_link.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link.c b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
> index c8457babfdea..fd5a0e7eb029 100644
> --- a/drivers/gpu/drm/amd/display/dc/core/dc_link.c
> +++ b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
> @@ -1844,6 +1844,8 @@ static void enable_stream_features(struct pipe_ctx *pipe_ctx)
> union down_spread_ctrl old_downspread;
> union down_spread_ctrl new_downspread;
>
> + memset(&old_downspread, 0, sizeof(old_downspread));
> +
> core_link_read_dpcd(link, DP_DOWNSPREAD_CTRL,
> &old_downspread.raw, sizeof(old_downspread));
>
> --
> 2.25.1
>
Powered by blists - more mailing lists