Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 12ec9f92 authored by Jean-Philippe Brucker's avatar Jean-Philippe Brucker Committed by Greg Kroah-Hartman
Browse files

drm/meson: Uninstall IRQ handler



[ Upstream commit 2d8f92897ad816f5dda54b2ed2fd9f2d7cb1abde ]

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: bbbe775e ("drm: Add support for Amlogic Meson Graphic Controller")
Signed-off-by: default avatarJean-Philippe Brucker <jean-philippe.brucker@arm.com>
Acked-by: default avatarNeil Armstrong <narmstrong@baylibre.com>
Signed-off-by: default avatarNeil Armstrong <narmstrong@baylibre.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190322152657.13752-2-jean-philippe.brucker@arm.com


Signed-off-by: default avatarSasha Levin (Microsoft) <sashal@kernel.org>
parent afc0ca59
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -277,10 +277,12 @@ 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;

	return 0;

uninstall_irq:
	drm_irq_uninstall(drm);
free_drm:
	drm_dev_unref(drm);

@@ -298,6 +300,7 @@ static void meson_drv_unbind(struct device *dev)
	struct drm_device *drm = priv->drm;

	drm_dev_unregister(drm);
	drm_irq_uninstall(drm);
	drm_kms_helper_poll_fini(drm);
	drm_fbdev_cma_fini(priv->fbdev);
	drm_mode_config_cleanup(drm);