aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Philippe Brucker <jean-philippe.brucker@arm.com>2019-03-22 11:26:57 -0400
committerNeil Armstrong <narmstrong@baylibre.com>2019-03-25 06:18:47 -0400
commit2d8f92897ad816f5dda54b2ed2fd9f2d7cb1abde (patch)
treecb747ddea9c75d7f786ae529b39b1a7bd1239b79
parent776e78677f514ecddd12dba48b9040958999bd5a (diff)
drm/meson: Uninstall IRQ handler
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> 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
-rw-r--r--drivers/gpu/drm/meson/meson_drv.c5
1 files changed, 4 insertions, 1 deletions
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)
337 337
338 ret = drm_dev_register(drm, 0); 338 ret = drm_dev_register(drm, 0);
339 if (ret) 339 if (ret)
340 goto free_drm; 340 goto uninstall_irq;
341 341
342 drm_fbdev_generic_setup(drm, 32); 342 drm_fbdev_generic_setup(drm, 32);
343 343
344 return 0; 344 return 0;
345 345
346uninstall_irq:
347 drm_irq_uninstall(drm);
346free_drm: 348free_drm:
347 drm_dev_put(drm); 349 drm_dev_put(drm);
348 350
@@ -367,6 +369,7 @@ static void meson_drv_unbind(struct device *dev)
367 } 369 }
368 370
369 drm_dev_unregister(drm); 371 drm_dev_unregister(drm);
372 drm_irq_uninstall(drm);
370 drm_kms_helper_poll_fini(drm); 373 drm_kms_helper_poll_fini(drm);
371 drm_mode_config_cleanup(drm); 374 drm_mode_config_cleanup(drm);
372 drm_dev_put(drm); 375 drm_dev_put(drm);