Skip to content

drm/logicvc: Avoid UAF in DRM object management

Romain Gantois dri-devel lkml sashiko-reviews stable 3 versions – In review

Get series with b4
b4 am [email protected] change-id 20260526-logicvc-uaf-eab103f0d0de

Versions newest first

  1. v3 Latest2 patches 1 replyIn review
  2. v22 patches 2 repliesSuperseded
  3. v11 patch 4 repliesSuperseded

Changes in v3 from the cover letter

- Added a required drm_device_enter() section.
- Removed unecessary drm_device_enter() sections.
- Cleared vblank events in atomic callbacks when device is unplugged.
- Link to v2: https://patch.msgid.link/[email protected]

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2drm/logicvc: Avoid use-after-free with devm_kzalloc()drivers/gpu/drm/logicvc/logicvc_crtc.c drivers/gpu/drm/logicvc/logicvc_interface.c drivers/gpu/drm/logicvc/logicvc_layer.c+75 -961 reply
2/2drm/logicvc: Avoid using DRM resources after device is unpluggeddrivers/gpu/drm/logicvc/logicvc_crtc.c drivers/gpu/drm/logicvc/logicvc_drm.c drivers/gpu/drm/logicvc/logicvc_interface.c +1 more+78 -70 replies

Reviews trailers per patch

1 of 2 patches has a Reviewed-by or Acked-by.

PatchMaxime Ripard
1/2R-b
2/2

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH v3 0/2] drm/logicvc: Avoid UAF in DRM object management

Hi everyone, this is version three of my series which fixes some memory management issues in the logicvc-drm driver.

Patch 1/2 migrates the driver to drmm to avoid accessing DRM objects after they have been freed by devm.

Patch 2/2 uses the unplug mechanism to ensure that DRM objects aren't accessed after the DRM device is removed.

Best Regards,

Romain

---
Changes in v3:
- Added a required drm_device_enter() section.
- Removed unecessary drm_device_enter() sections.
- Cleared vblank events in atomic callbacks when device is unplugged.
- Link to v2: https://patch.msgid.link/[email protected]

Changes in v2:
- Added protection of DRM device resources after removal using drm_dev_enter()
- Link to v1: https://patch.msgid.link/[email protected]

To: Paul Kocialkowski <[email protected]>
To: Maarten Lankhorst <[email protected]>
To: Maxime Ripard <[email protected]>
To: Thomas Zimmermann <[email protected]>
To: David Airlie <[email protected]>
To: Simona Vetter <[email protected]>
Cc: Jason Xiang <[email protected]>
Cc: Thomas Petazzoni <[email protected]>
Cc: Paul Kocialkowski <[email protected]>
Cc: [email protected]
Cc: [email protected]

---
Romain Gantois (2):
drm/logicvc: Avoid use-after-free with devm_kzalloc() drm/logicvc: Avoid using DRM resources after device is unplugged

 drivers/gpu/drm/logicvc/logicvc_crtc.c      |  56 +++++++++---
 drivers/gpu/drm/logicvc/logicvc_drm.c       |   6 +-
 drivers/gpu/drm/logicvc/logicvc_interface.c |  61 ++++++-------
 drivers/gpu/drm/logicvc/logicvc_layer.c     | 133 +++++++++++++++-------------
 4 files changed, 153 insertions(+), 103 deletions(-)

---
base-commit: 44e151be23deb788d9f6124de93823faf6e04e99
change-id: 20260526-logicvc-uaf-eab103f0d0de

Best regards,

Signature · 1 line
Romain Gantois <[email protected]>