mirror_ubuntu-kernels/drivers/gpu/drm/vc4
Maxime Ripard fe7289e218
drm/vc4: vec: Switch to drmm_kzalloc
Our internal structure that stores the DRM entities structure is allocated
through a device-managed kzalloc.

This means that this will eventually be freed whenever the device is
removed. In our case, the most likely source of removal is that the main
device is going to be unbound, and component_unbind_all() is being run.

However, it occurs while the DRM device is still registered, which will
create dangling pointers, eventually resulting in use-after-free.

Switch to a DRM-managed allocation to keep our structure until the DRM
driver doesn't need it anymore.

Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Link: https://lore.kernel.org/r/20220711173939.1132294-57-maxime@cerno.tech
2022-07-13 10:46:12 +02:00
..
Kconfig drm/vc4: hdmi: Depends on CONFIG_PM 2022-07-08 10:45:29 +02:00
Makefile drm/vc4: hdmi: Add PHY init and disable function 2020-09-07 18:06:04 +02:00
vc4_bo.c Linux 5.19-rc6 2022-07-13 10:54:56 +10:00
vc4_crtc.c drm/vc4: crtc: Switch to DRM-managed CRTC initialization 2022-07-13 10:46:07 +02:00
vc4_debugfs.c drm/vc4: Leverage the load tracker on the BCM2711 2021-11-04 10:36:25 +01:00
vc4_dpi.c drm/vc4: dpi: Protect device resources 2022-07-13 10:46:09 +02:00
vc4_drv.c drm/vc4: drv: Use drm_dev_unplug 2022-07-13 10:46:06 +02:00
vc4_drv.h drm/vc4: vec: Remove vc4_dev vec pointer 2022-07-13 10:46:11 +02:00
vc4_dsi.c drm/vc4: dsi: Switch to devm_pm_runtime_enable 2022-07-13 10:46:09 +02:00
vc4_fence.c
vc4_gem.c drm/vc4: Warn if some v3d code is run on BCM2711 2022-06-16 11:07:52 +02:00
vc4_hdmi_phy.c drm/vc4: hdmi: Rename pixel_rate variable 2022-03-24 13:43:59 +01:00
vc4_hdmi_regs.h drm/vc4: hdmi: Add MISC_CONTROL register for vc4 2022-06-28 14:56:08 +02:00
vc4_hdmi.c drm/vc4: hdmi: Switch to devm_pm_runtime_enable 2022-07-13 10:46:11 +02:00
vc4_hdmi.h drm/vc4: hdmi: Switch to DRM-managed kfree to build regsets 2022-07-13 10:46:10 +02:00
vc4_hvs.c drm/vc4: hvs: Remove planes currently allocated before taking down 2022-07-13 10:46:07 +02:00
vc4_irq.c drm/vc4: Warn if some v3d code is run on BCM2711 2022-06-16 11:07:52 +02:00
vc4_kms.c Linux 5.19-rc6 2022-07-13 10:54:56 +10:00
vc4_packet.h
vc4_perfmon.c drm/vc4: perfmon: Fix variable dereferenced before check 2022-06-27 15:43:14 +02:00
vc4_plane.c drm/vc4: plane: Switch to drmm_universal_plane_alloc() 2022-07-13 10:46:07 +02:00
vc4_qpu_defines.h
vc4_regs.h drm/vc4: drop unexpected word "the" in the comments 2022-06-22 09:22:55 +02:00
vc4_render_cl.c drm/vc4: Warn if some v3d code is run on BCM2711 2022-06-16 11:07:52 +02:00
vc4_trace_points.c
vc4_trace.h drm/vc4: add tracepoints for CL submissions 2022-03-17 15:12:25 +01:00
vc4_txp.c drm/vc4: txp: Protect device resources 2022-07-13 10:46:11 +02:00
vc4_v3d.c drm/vc4: Warn if some v3d code is run on BCM2711 2022-06-16 11:07:52 +02:00
vc4_validate_shaders.c drm/vc4: Warn if some v3d code is run on BCM2711 2022-06-16 11:07:52 +02:00
vc4_validate.c drm/vc4: fix error code in vc4_check_tex_size() 2022-06-22 16:41:30 +02:00
vc4_vec.c drm/vc4: vec: Switch to drmm_kzalloc 2022-07-13 10:46:12 +02:00