bianbu-linux-6.6/drivers/gpu/drm/vc4
Maxime Ripard e733f3e9dc drm/vc4: tests: Fix UAF in the mock helpers
[ Upstream commit cdcd6aef9db5797995d4153ea19fdf56d189f0e4 ]

The VC4 mock helpers allocate the CRTC, encoders and connectors using a
call to kunit_kzalloc(), but the DRM device they are attache to survives
for longer than the test itself which leads to use-after-frees reported
by KASAN.

Switch to drmm_kzalloc to tie the lifetime of these objects to the main
DRM device.

Fixes: f759f5b53f ("drm/vc4: tests: Introduce a mocking infrastructure")
Reported-by: Linux Kernel Functional Testing <lkft@linaro.org>
Closes: https://lore.kernel.org/all/CA+G9fYvJA2HGqzR9LGgq63v0SKaUejHAE6f7+z9cwWN-ourJ_g@mail.gmail.com/
Tested-by: Anders Roxell <anders.roxell@linaro.org>
Reviewed-by: Maíra Canal <mcanal@igalia.com>
Signed-off-by: Maxime Ripard <mripard@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20231024105640.352752-1-mripard@kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-11-20 11:59:37 +01:00
..
tests drm/vc4: tests: Fix UAF in the mock helpers 2023-11-20 11:59:37 +01:00
Kconfig drm/vc4: allow DRM_VC4_KUNIT_TEST to be a loadable module 2023-02-02 13:37:26 +01:00
Makefile drm/vc4: tests: Add unit test suite for the PV muxing 2022-12-08 09:56:56 +01:00
vc4_bo.c Linux 6.2-rc6 2023-01-31 12:23:23 +01:00
vc4_crtc.c drm: Explicitly include correct DT includes 2023-07-21 09:12:43 +02:00
vc4_debugfs.c drm/vc4: use new debugfs device-centered functions 2022-12-22 14:59:16 -03:00
vc4_dpi.c drm: Explicitly include correct DT includes 2023-07-21 09:12:43 +02:00
vc4_drv.c drm: Explicitly include correct DT includes 2023-07-21 09:12:43 +02:00
vc4_drv.h drm/vc4: Switch to container_of_const 2023-04-25 09:32:25 +02:00
vc4_dsi.c drm: Explicitly include correct DT includes 2023-07-21 09:12:43 +02:00
vc4_fence.c
vc4_gem.c drm/vc4: replace obj lookup steps with drm_gem_objects_lookup 2023-02-28 17:51:04 -03:00
vc4_hdmi.c sound updates for 6.6-rc1 2023-08-30 13:45:05 -07:00
vc4_hdmi.h drm/vc4: hdmi: Add Broadcast RGB property to allow override of RGB range 2023-04-25 09:32: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: tests: Fail the current test if we access a register 2022-12-08 09:56:56 +01:00
vc4_hvs.c drm/vc4: Convert to platform remove callback returning void 2023-06-08 09:04:13 -07:00
vc4_irq.c drm/vc4: remove unused render_wait variable 2023-04-11 14:15:18 +02:00
vc4_kms.c drm/vc4: Switch to container_of_const 2023-04-25 09:32:25 +02:00
vc4_packet.h
vc4_perfmon.c drm/vc4: perfmon: Add missing mutex_destroy 2022-07-13 10:46:13 +02:00
vc4_plane.c drm/vc4: Switch to container_of_const 2023-04-25 09:32:25 +02:00
vc4_qpu_defines.h
vc4_regs.h drm/vc4: Add comments for which HVS_PIXEL_ORDER_xxx defines apply 2023-01-09 15:21:31 +01:00
vc4_render_cl.c drm/gem: rename struct drm_gem_dma_object.{paddr => dma_addr} 2022-08-03 18:32:27 +02:00
vc4_trace.h drm/vc4: add tracepoints for CL submissions 2022-03-17 15:12:25 +01:00
vc4_trace_points.c
vc4_txp.c drm: Explicitly include correct DT includes 2023-07-21 09:12:43 +02:00
vc4_v3d.c drm/vc4: Convert to platform remove callback returning void 2023-06-08 09:04:13 -07:00
vc4_validate.c drm/vc4: replace drm_gem_dma_object for drm_gem_object in vc4_exec_info 2023-02-28 17:51:03 -03:00
vc4_validate_shaders.c drm/gem: rename GEM CMA helpers to GEM DMA helpers 2022-08-03 18:31:49 +02:00
vc4_vec.c drm: Explicitly include correct DT includes 2023-07-21 09:12:43 +02:00