]> www.infradead.org Git - users/jedix/linux-maple.git/commit
Revert "drm/amdgpu: Use dma_buf from GEM object instance"
authorThomas Zimmermann <tzimmermann@suse.de>
Tue, 15 Jul 2025 08:26:22 +0000 (10:26 +0200)
committerThomas Zimmermann <tzimmermann@suse.de>
Wed, 13 Aug 2025 09:14:17 +0000 (11:14 +0200)
commit3eb61d7cb74cea2ea697363669fa256937164758
tree24f1ce23ced8167164f8025f17e203a5b9cdd6cb
parent9af8f2b469c0438620832f3729a3c5c03853b56b
Revert "drm/amdgpu: Use dma_buf from GEM object instance"

This reverts commit 515986100d176663d0a03219a3056e4252f729e6.

The dma_buf field in struct drm_gem_object is not stable over the
object instance's lifetime. The field becomes NULL when user space
releases the final GEM handle on the buffer object. This resulted
in a NULL-pointer deref.

Workarounds in commit 5307dce878d4 ("drm/gem: Acquire references on
GEM handles for framebuffers") and commit f6bfc9afc751 ("drm/framebuffer:
Acquire internal references on GEM handles") only solved the problem
partially. They especially don't work for buffer objects without a DRM
framebuffer associated.

Hence, this revert to going back to using .import_attach->dmabuf.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Simona Vetter <simona.vetter@ffwll.ch>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Link: https://lore.kernel.org/r/20250715082635.34974-1-tzimmermann@suse.de
drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c