lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <5bc5dd90-fbf7-e999-8024-1269eeb78b93@amd.com>
Date:   Thu, 23 Dec 2021 10:53:23 -0500
From:   Harry Wentland <harry.wentland@....com>
To:     José Expósito <jose.exposito89@...il.com>
Cc:     sunpeng.li@....com, Rodrigo.Siqueira@....com,
        alexander.deucher@....com, christian.koenig@....com,
        Xinhui.Pan@....com, airlied@...ux.ie, charlene.liu@....com,
        amd-gfx@...ts.freedesktop.org, dri-devel@...ts.freedesktop.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] drm/amd/display: fix dereference before NULL check

On 2021-12-16 13:14, José Expósito wrote:
> The "plane_state" pointer was access before checking if it was NULL.
> 
> Avoid a possible NULL pointer dereference by accessing the plane
> address after the check.
> 
> Addresses-Coverity-ID: 1474582 ("Dereference before null check")
> Fixes: 3f68c01be9a22 ("drm/amd/display: add cyan_skillfish display support")
> Signed-off-by: José Expósito <jose.exposito89@...il.com>

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

Harry

> ---
>  drivers/gpu/drm/amd/display/dc/dcn201/dcn201_hwseq.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/amd/display/dc/dcn201/dcn201_hwseq.c b/drivers/gpu/drm/amd/display/dc/dcn201/dcn201_hwseq.c
> index cfd09b3f705e..fe22530242d2 100644
> --- a/drivers/gpu/drm/amd/display/dc/dcn201/dcn201_hwseq.c
> +++ b/drivers/gpu/drm/amd/display/dc/dcn201/dcn201_hwseq.c
> @@ -134,11 +134,12 @@ void dcn201_update_plane_addr(const struct dc *dc, struct pipe_ctx *pipe_ctx)
>  	PHYSICAL_ADDRESS_LOC addr;
>  	struct dc_plane_state *plane_state = pipe_ctx->plane_state;
>  	struct dce_hwseq *hws = dc->hwseq;
> -	struct dc_plane_address uma = plane_state->address;
> +	struct dc_plane_address uma;
>  
>  	if (plane_state == NULL)
>  		return;
>  
> +	uma = plane_state->address;
>  	addr_patched = patch_address_for_sbs_tb_stereo(pipe_ctx, &addr);
>  
>  	plane_address_in_gpu_space_to_uma(hws, &uma);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ