(subset) [PATCH] drm/vc4: tests: Fix UAF in the mock helpers

Maxime Ripard mripard at kernel.org
Thu Oct 26 11:05:01 UTC 2023


On Tue, 24 Oct 2023 12:56:40 +0200, Maxime Ripard wrote:
> 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.
> 
> [...]

Applied to drm/drm-misc (drm-misc-fixes).

Thanks!
Maxime



More information about the dri-devel mailing list