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

2023-10-26 Thread Maxime Ripard
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. > > Sw

Re: [PATCH] drm/vc4: tests: Fix UAF in the mock helpers

2023-10-26 Thread Anders Roxell
On Tue, 24 Oct 2023 at 18:38, Maíra Canal wrote: > > On 10/24/23 07:56, 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 u

Re: [PATCH] drm/vc4: tests: Fix UAF in the mock helpers

2023-10-24 Thread Maíra Canal
On 10/24/23 07:56, 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

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

2023-10-24 Thread Maxime Ripard
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