mbox series

[0/3] drm/vc4: use drm managed resources

Message ID 20220713085500.1970589-1-dakr@redhat.com (mailing list archive)
Headers show
Series drm/vc4: use drm managed resources | expand

Message

Danilo Krummrich July 13, 2022, 8:54 a.m. UTC
This patch series converts DRM modeset object allocations from devm_*()
to drmm_*() memory allocators, or their corresponding convenience
wrappers, respectively, in order to tie the release action to the
underlaying struct drm_device.

This can prevent potential use-after free issues on driver unload or
EPROBE_DEFERRED backoff.

Danilo Krummrich (3):
  drm/vc4: plane: use drm managed resources
  drm/vc4: crtc: use drm managed resources
  drm/vc4: encoder: use drm managed resources

 drivers/gpu/drm/vc4/vc4_crtc.c  |  2 +-
 drivers/gpu/drm/vc4/vc4_dpi.c   | 11 ++++++-----
 drivers/gpu/drm/vc4/vc4_dsi.c   | 10 +++++-----
 drivers/gpu/drm/vc4/vc4_hdmi.c  | 10 ++++++----
 drivers/gpu/drm/vc4/vc4_plane.c | 19 +++++++------------
 drivers/gpu/drm/vc4/vc4_txp.c   |  2 +-
 drivers/gpu/drm/vc4/vc4_vec.c   | 11 ++++++-----
 7 files changed, 32 insertions(+), 33 deletions(-)

Comments

Maxime Ripard July 13, 2022, 9:10 a.m. UTC | #1
Hi Danilo,

On Wed, Jul 13, 2022 at 10:54:57AM +0200, Danilo Krummrich wrote:
> This patch series converts DRM modeset object allocations from devm_*()
> to drmm_*() memory allocators, or their corresponding convenience
> wrappers, respectively, in order to tie the release action to the
> underlaying struct drm_device.
> 
> This can prevent potential use-after free issues on driver unload or
> EPROBE_DEFERRED backoff.

Yeah, the driver had a lot of this kind of issues.

As it turns out, at the moment you sent it, I was applying a larger
series (hopefully) addressing all of them:
https://lore.kernel.org/all/20220711173939.1132294-1-maxime@cerno.tech/

Maxime
Danilo Krummrich July 14, 2022, 2:27 p.m. UTC | #2
Hi Maxime,

On 7/13/22 11:10, Maxime Ripard wrote:
> Hi Danilo,
> 
> On Wed, Jul 13, 2022 at 10:54:57AM +0200, Danilo Krummrich wrote:
>> This patch series converts DRM modeset object allocations from devm_*()
>> to drmm_*() memory allocators, or their corresponding convenience
>> wrappers, respectively, in order to tie the release action to the
>> underlaying struct drm_device.
>>
>> This can prevent potential use-after free issues on driver unload or
>> EPROBE_DEFERRED backoff.
> 
> Yeah, the driver had a lot of this kind of issues.
> 
> As it turns out, at the moment you sent it, I was applying a larger
> series (hopefully) addressing all of them:
> https://lore.kernel.org/all/20220711173939.1132294-1-maxime@cerno.tech/
Ah, great! That's covering even more than the series I sent.
> 
> Maxime

- Danilo