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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7155ecfc-1aff-002d-9cc6-e097525e7cb6@amd.com>
Date:   Fri, 8 Nov 2019 14:42:03 +0000
From:   Mikita Lipski <mlipski@....com>
To:     Colin King <colin.king@...onical.com>,
        "Wentland, Harry" <Harry.Wentland@....com>,
        "Li, Sun peng (Leo)" <Sunpeng.Li@....com>,
        "Deucher, Alexander" <Alexander.Deucher@....com>,
        "Koenig, Christian" <Christian.Koenig@....com>,
        "Zhou, David(ChunMing)" <David1.Zhou@....com>,
        David Airlie <airlied@...ux.ie>,
        Daniel Vetter <daniel@...ll.ch>, Lyude Paul <lyude@...hat.com>,
        "Kazlauskas, Nicholas" <Nicholas.Kazlauskas@....com>,
        "Lipski, Mikita" <Mikita.Lipski@....com>,
        "amd-gfx@...ts.freedesktop.org" <amd-gfx@...ts.freedesktop.org>,
        "dri-devel@...ts.freedesktop.org" <dri-devel@...ts.freedesktop.org>
CC:     "kernel-janitors@...r.kernel.org" <kernel-janitors@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH][next] drm/amd/display: fix dereference of pointer
 aconnector when it is null

Thanks!

Reviewed-by: Mikita Lipski <mikita.lipski@....com>

On 08.11.2019 9:38, Colin King wrote:
> From: Colin Ian King <colin.king@...onical.com>
> 
> Currently pointer aconnector is being dereferenced by the call to
> to_dm_connector_state before it is being null checked, this could
> lead to a null pointer dereference.  Fix this by checking that
> aconnector is null before dereferencing it.
> 
> Addresses-Coverity: ("Dereference before null check")
> Fixes: 5133c6241d9c ("drm/amd/display: Add MST atomic routines")
> Signed-off-by: Colin Ian King <colin.king@...onical.com>
> ---
>   drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 5 ++---
>   1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
> index e3cda6984d28..72e677796a48 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
> @@ -193,12 +193,11 @@ bool dm_helpers_dp_mst_write_payload_allocation_table(
>   	 * that blocks before commit guaranteeing that the state
>   	 * is not gonna be swapped while still in use in commit tail */
>   
> -	dm_conn_state = to_dm_connector_state(aconnector->base.state);
> -
> -
>   	if (!aconnector || !aconnector->mst_port)
>   		return false;
>   
> +	dm_conn_state = to_dm_connector_state(aconnector->base.state);
> +
>   	mst_mgr = &aconnector->mst_port->mst_mgr;
>   
>   	if (!mst_mgr->mst_state)
> 

-- 
Thanks,
Mikita Lipski
mikita.lipski@....com

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ