Skip to content

Commit

Permalink
drm/meson: Uninstall IRQ handler
Browse files Browse the repository at this point in the history
[ Upstream commit 2d8f928 ]

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: bbbe775 ("drm: Add support for Amlogic Meson Graphic Controller")
Signed-off-by: Jean-Philippe Brucker <jean-philippe.brucker@arm.com>
Acked-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190322152657.13752-2-jean-philippe.brucker@arm.com
Signed-off-by: Sasha Levin (Microsoft) <sashal@kernel.org>
  • Loading branch information
Jean-Philippe Brucker authored and gregkh committed May 4, 2019
1 parent da9c64d commit e24c542
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/gpu/drm/meson/meson_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -317,12 +317,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);

Expand All @@ -347,6 +349,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);
Expand Down

0 comments on commit e24c542

Please sign in to comment.