linux/drivers/gpu/drm/vc4/tests
Maxime Ripard cdcd6aef9d
drm/vc4: tests: Fix UAF in the mock helpers
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
2023-10-26 13:03:14 +02:00
..
.kunitconfig
vc4_mock_crtc.c drm/vc4: tests: Fix UAF in the mock helpers 2023-10-26 13:03:14 +02:00
vc4_mock_output.c drm/vc4: tests: Fix UAF in the mock helpers 2023-10-26 13:03:14 +02:00
vc4_mock_plane.c
vc4_mock.c drm/vc4: tests: mock: Use a kunit action to unregister DRM device 2023-07-31 14:19:57 +02:00
vc4_mock.h drm/vc4: Switch to container_of_const 2023-04-25 09:32:25 +02:00
vc4_test_pv_muxing.c drm/vc4: tests: pv-muxing: Document test scenario 2023-07-31 14:19:58 +02:00