[PATCH 0/2] Fix AMDGPU VRAM zeroing
Natalie Vock
natalie.vock at gmx.de
Tue May 27 19:43:51 UTC 2025
Hi all,
I've stumbled upon this while investigating why AMDGPU seems to fail at
providing cleared VRAM allocations despite being explicitly asked to
with AMDGPU_GEM_CREATE_VRAM_CLEARED[1].
After some code inspection, I believe the problem is actually much worse
than not providing cleared VRAM. AMDGPU fails to track dirty vs. cleared
allocations properly in general, and still considers initially-cleared
memory that has since been overwritten by applications as cleared. In
consequence, it will skip wiping the memory after the application frees
it, leaking the contents to arbitrary other applications.
With the new drm_buddy helper, there is some cleanup potential as
drm_buddy.c defines an identical helper as a static function. However,
to keep the patch as minimal as possible for stable backporting, I'll
submit the cleanup as a follow-up patch instead.
Thanks,
Natalie
[1] https://gitlab.freedesktop.org/drm/amd/-/issues/3812
Natalie Vock (2):
drm/buddy: Add public helper to dirty blocks
drm/amdgpu: Dirty cleared blocks on allocation
drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c | 7 +++++++
include/drm/drm_buddy.h | 6 ++++++
2 files changed, 13 insertions(+)
--
2.49.0
More information about the dri-devel
mailing list