public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] drm/rockchip: Fix unbind/bind
@ 2020-01-20 17:05 Ezequiel Garcia
  2020-01-20 17:05 ` [PATCH 1/5] component: Add an API to cleanup before unbind Ezequiel Garcia
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Ezequiel Garcia @ 2020-01-20 17:05 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Rafael J . Wysocki, Sandy Huang,
	Heiko Stübner, David Airlie, Daniel Vetter
  Cc: linux-rockchip, linux-arm-kernel, dri-devel, linux-kernel, kernel,
	Ezequiel Garcia

This series is an attempt to fix the unbind/bind crash
(due to an use-after-free bug) found on rockchip-drm driver.

The problem lies in the way the driver uses the component API.
Currently, rockchip_drm_unbind calls component_unbind_all before
drm_mode_config_cleanup, the former releasing the memory
where the DRM objects are embedded.

The series goal is basically to fix all the components,
making proper use of the respective .destroy hooks,
making sure there are no use-after-free or double-free issues.

The first patch is likely the most controversial, which is required
because component_bind_all will call component_unbind without
calling drm_mode_config_cleanup, if any component fails to bind.
As mentioned above, this is problematic in the DRM framework.

Thanks!
Ezequiel

Ezequiel Garcia (5):
  component: Add an API to cleanup before unbind
  drm/rockchip: Fix the device unbind order
  drm/rockchip: vop: Fix CRTC unbind
  drm/rockchip: lvds: Fix component unbind
  drm/rockchip: rk3066_hdmi: Cleanup component unbind

 drivers/base/component.c                    |  9 +++-
 drivers/gpu/drm/rockchip/rk3066_hdmi.c      |  8 +--
 drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 20 +++++---
 drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 56 ++++++++-------------
 drivers/gpu/drm/rockchip/rockchip_lvds.c    | 20 ++++----
 include/linux/component.h                   | 10 +++-
 6 files changed, 60 insertions(+), 63 deletions(-)

-- 
2.25.0


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-01-20 17:06 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-01-20 17:05 [PATCH 0/5] drm/rockchip: Fix unbind/bind Ezequiel Garcia
2020-01-20 17:05 ` [PATCH 1/5] component: Add an API to cleanup before unbind Ezequiel Garcia
2020-01-20 17:05 ` [PATCH 2/5] drm/rockchip: Fix the device unbind order Ezequiel Garcia
2020-01-20 17:06 ` [PATCH 3/5] drm/rockchip: vop: Fix CRTC unbind Ezequiel Garcia
2020-01-20 17:06 ` [PATCH 4/5] drm/rockchip: lvds: Fix component unbind Ezequiel Garcia
2020-01-20 17:06 ` [PATCH 5/5] drm/rockchip: rk3066_hdmi: Cleanup " Ezequiel Garcia

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox