dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Maxime Ripard <maxime.ripard-LDxbnhwyfcJBDgjK7y7TUQ@public.gmane.org>
To: megous-5qf/QAjKc83QT0dZR+AlfA@public.gmane.org
Cc: linux-sunxi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org,
	David Airlie <airlied-cv59FeDIM0c@public.gmane.org>,
	Daniel Vetter <daniel-/w4YWyX8dFk@public.gmane.org>,
	Chen-Yu Tsai <wens-jdAy2FN1RRM@public.gmane.org>,
	"open list:DRM DRIVERS FOR ALLWINNER A10"
	<dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>,
	"moderated list:ARM/Allwinner sunXi SoC support"
	<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>,
	open list <linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH] drm: sun4i: Fix NULL/invalid pointer dereference in sun8i_tcon_top_un/bind
Date: Mon, 8 Apr 2019 10:31:10 +0200	[thread overview]
Message-ID: <20190408083110.iy3auc7ggindifbf@flea> (raw)
In-Reply-To: <20190405233048.3823-1-megous-5qf/QAjKc83QT0dZR+AlfA@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 1410 bytes --]

On Sat, Apr 06, 2019 at 01:30:48AM +0200, megous-5qf/QAjKc83QT0dZR+AlfA@public.gmane.org wrote:
> From: Ondrej Jirman <megous-5qf/QAjKc83QT0dZR+AlfA@public.gmane.org>
>
> There are two problems here:
>
> 1. Not all clk_data->hws[] need to be initialized, depending on various
>    configured quirks. This leads to NULL ptr deref in
>    clk_hw_unregister_gate() in sun8i_tcon_top_unbind()
> 2. If there is error when registering the clk_data->hws[],
>    err_unregister_gates error path will try to unregister
>    IS_ERR()=true (invalid) pointer.
>
> For problem (1) I have this stack trace:
>
> Unable to handle kernel NULL pointer dereference at virtual
>   address 0000000000000008
> Call trace:
>  clk_hw_unregister+0x8/0x18
>  clk_hw_unregister_gate+0x14/0x28
>  sun8i_tcon_top_unbind+0x2c/0x60
>  component_unbind.isra.4+0x2c/0x50
>  component_bind_all+0x1d4/0x230
>  sun4i_drv_bind+0xc4/0x1a0
>  try_to_bring_up_master+0x164/0x1c0
>  __component_add+0xa0/0x168
>  component_add+0x10/0x18
>  sun8i_dw_hdmi_probe+0x18/0x20
>  platform_drv_probe+0x3c/0x70
>  really_probe+0xcc/0x278
>  driver_probe_device+0x34/0xa8
>
> Problem (2) was identified by head scratching.
>
> Signed-off-by: Ondrej Jirman <megous-5qf/QAjKc83QT0dZR+AlfA@public.gmane.org>

Changed the prefix to drm/sun4i: tcon top: and applied

Thanks!
Maxime

--
Maxime Ripard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

      parent reply	other threads:[~2019-04-08  8:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-05 23:30 [PATCH] drm: sun4i: Fix NULL/invalid pointer dereference in sun8i_tcon_top_un/bind megous via linux-sunxi
     [not found] ` <20190405233048.3823-1-megous-5qf/QAjKc83QT0dZR+AlfA@public.gmane.org>
2019-04-08  8:31   ` Maxime Ripard [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190408083110.iy3auc7ggindifbf@flea \
    --to=maxime.ripard-ldxbnhwyfcjbdgjk7y7tuq@public.gmane.org \
    --cc=airlied-cv59FeDIM0c@public.gmane.org \
    --cc=daniel-/w4YWyX8dFk@public.gmane.org \
    --cc=dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-sunxi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org \
    --cc=megous-5qf/QAjKc83QT0dZR+AlfA@public.gmane.org \
    --cc=wens-jdAy2FN1RRM@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox