linux-amlogic.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Neil Armstrong <narmstrong@baylibre.com>
To: Jean-Philippe Brucker <jean-philippe.brucker@arm.com>
Cc: airlied@linux.ie, khilman@baylibre.com,
	dri-devel@lists.freedesktop.org, daniel@ffwll.ch,
	linux-amlogic@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 2/2] drm/meson: Uninstall IRQ handler
Date: Sat, 23 Mar 2019 10:54:04 +0100	[thread overview]
Message-ID: <5C96023C.6050809@baylibre.com> (raw)
In-Reply-To: <20190322152657.13752-2-jean-philippe.brucker@arm.com>

Hi Jean-Philippe,

Le 22/03/2019 16:26, Jean-Philippe Brucker a écrit :
> meson_drv_unbind() doesn't unregister the IRQ handler, which can lead to
> use-after-free if the IRQ fires after unbind:
> 
> [   64.656876] Unable to handle kernel paging request at virtual address ffff000011706dbc
> ...
> [   64.662001] pc : meson_irq+0x18/0x30 [meson_drm]
> 
> I'm assuming that a similar problem could happen on the error path of
> bind(), so uninstall the IRQ handler there as well.
> 
> Fixes: bbbe775ec5b5 ("drm: Add support for Amlogic Meson Graphic Controller")
> Signed-off-by: Jean-Philippe Brucker <jean-philippe.brucker@arm.com>
> ---
>  drivers/gpu/drm/meson/meson_drv.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)

Thanks for working on this,
Acked-by: Neil Armstrong <narmstrong@baylibre.com>

I'll push it on drm-misc-fixes

> 
> diff --git a/drivers/gpu/drm/meson/meson_drv.c b/drivers/gpu/drm/meson/meson_drv.c
> index 7e85802c5398..8a4ebcb6405c 100644
> --- a/drivers/gpu/drm/meson/meson_drv.c
> +++ b/drivers/gpu/drm/meson/meson_drv.c
> @@ -337,12 +337,14 @@ static int meson_drv_bind_master(struct device *dev, bool has_components)
>  
>  	ret = drm_dev_register(drm, 0);
>  	if (ret)
> -		goto free_drm;
> +		goto uninstall_irq;
>  
>  	drm_fbdev_generic_setup(drm, 32);
>  
>  	return 0;
>  
> +uninstall_irq:
> +	drm_irq_uninstall(drm);
>  free_drm:
>  	drm_dev_put(drm);
>  
> @@ -367,6 +369,7 @@ static void meson_drv_unbind(struct device *dev)
>  	}
>  
>  	drm_dev_unregister(drm);
> +	drm_irq_uninstall(drm);
>  	drm_kms_helper_poll_fini(drm);
>  	drm_mode_config_cleanup(drm);
>  	drm_dev_put(drm);
> 

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

  reply	other threads:[~2019-03-23  9:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-22 15:26 [PATCH 1/2] drm/meson: Fix invalid pointer in meson_drv_unbind() Jean-Philippe Brucker
2019-03-22 15:26 ` [PATCH 2/2] drm/meson: Uninstall IRQ handler Jean-Philippe Brucker
2019-03-23  9:54   ` Neil Armstrong [this message]
2019-03-23  9:53 ` [PATCH 1/2] drm/meson: Fix invalid pointer in meson_drv_unbind() Neil Armstrong
2019-03-25 10:19 ` Neil Armstrong

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=5C96023C.6050809@baylibre.com \
    --to=narmstrong@baylibre.com \
    --cc=airlied@linux.ie \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jean-philippe.brucker@arm.com \
    --cc=khilman@baylibre.com \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=linux-arm-kernel@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).