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] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230622113520.GM18491@pengutronix.de>
Date:   Thu, 22 Jun 2023 13:35:20 +0200
From:   Sascha Hauer <s.hauer@...gutronix.de>
To:     Jonas Karlman <jonas@...boo.se>
Cc:     Sandy Huang <hjc@...k-chips.com>, Heiko Stuebner <heiko@...ech.de>,
        David Airlie <airlied@...il.com>,
        Daniel Vetter <daniel@...ll.ch>,
        Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
        Mark Yao <markyao0591@...il.com>,
        Andy Yan <andy.yan@...k-chips.com>,
        dri-devel@...ts.freedesktop.org,
        linux-arm-kernel@...ts.infradead.org,
        linux-rockchip@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 3/5] drm/rockchip: vop: Fix call to crtc reset helper

On Wed, Jun 21, 2023 at 10:33:20PM +0000, Jonas Karlman wrote:
> Allocation of crtc_state may fail in vop_crtc_reset, causing an invalid
> pointer to be passed to __drm_atomic_helper_crtc_reset.
> 
> Fix this by adding a NULL check of crtc_state, similar to other drivers.
> 
> Fixes: 01e2eaf40c9d ("drm/rockchip: Convert to using __drm_atomic_helper_crtc_reset() for reset.")
> Signed-off-by: Jonas Karlman <jonas@...boo.se>

Reviewed-by: Sascha Hauer <s.hauer@...gutronix.de>

Sascha

> ---
> v2:
> - New patch
> 
>  drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
> index 25c873d4ff53..23bc79064e78 100644
> --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
> +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
> @@ -1630,7 +1630,10 @@ static void vop_crtc_reset(struct drm_crtc *crtc)
>  	if (crtc->state)
>  		vop_crtc_destroy_state(crtc, crtc->state);
>  
> -	__drm_atomic_helper_crtc_reset(crtc, &crtc_state->base);
> +	if (crtc_state)
> +		__drm_atomic_helper_crtc_reset(crtc, &crtc_state->base);
> +	else
> +		__drm_atomic_helper_crtc_reset(crtc, NULL);
>  }
>  
>  #ifdef CONFIG_DRM_ANALOGIX_DP
> -- 
> 2.41.0
> 
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ