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: <b229a86e-3f0b-4059-8a1e-de5be71cf3d8@linaro.org>
Date: Mon, 5 Jan 2026 16:16:08 +0100
From: neil.armstrong@...aro.org
To: Tuo Li <islituo@...il.com>, jesszhan0024@...il.com,
 maarten.lankhorst@...ux.intel.com, mripard@...nel.org, tzimmermann@...e.de,
 airlied@...il.com, simona@...ll.ch
Cc: dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] drm/panel: Fix a possible null-pointer dereference in
 jdi_panel_dsi_remove()

On 12/18/25 13:09, Tuo Li wrote:
> In jdi_panel_dsi_remove(), jdi is explicitly checked, indicating that it
> may be NULL:
> 
>    if (!jdi)
>      mipi_dsi_detach(dsi);
> 
> However, when jdi is NULL, the function does not return and continues by
> calling jdi_panel_disable():
> 
>    err = jdi_panel_disable(&jdi->base);
> 
> Inside jdi_panel_disable(), jdi is dereferenced unconditionally, which can
> lead to a NULL-pointer dereference:
> 
>    struct jdi_panel *jdi = to_panel_jdi(panel);
>    backlight_disable(jdi->backlight);
> 
> To prevent such a potential NULL-pointer dereference, return early from
> jdi_panel_dsi_remove() when jdi is NULL.
> 
> Signed-off-by: Tuo Li <islituo@...il.com>
> ---
>   drivers/gpu/drm/panel/panel-jdi-lpm102a188a.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/panel/panel-jdi-lpm102a188a.c b/drivers/gpu/drm/panel/panel-jdi-lpm102a188a.c
> index 23462065d726..ea975170faff 100644
> --- a/drivers/gpu/drm/panel/panel-jdi-lpm102a188a.c
> +++ b/drivers/gpu/drm/panel/panel-jdi-lpm102a188a.c
> @@ -434,8 +434,10 @@ static void jdi_panel_dsi_remove(struct mipi_dsi_device *dsi)
>   	int err;
>   
>   	/* only detach from host for the DSI-LINK2 interface */
> -	if (!jdi)
> +	if (!jdi) {
>   		mipi_dsi_detach(dsi);
> +		return;
> +	}
>   
>   	err = jdi_panel_disable(&jdi->base);
>   	if (err < 0)

Reviewed-by: Neil Armstrong <neil.armstrong@...aro.org>

Thanks,
Neil

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ