dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] Fix AMDGPU VRAM zeroing
@ 2025-05-27 19:43 Natalie Vock
  2025-05-27 19:43 ` [PATCH 1/2] drm/buddy: Add public helper to dirty blocks Natalie Vock
  2025-05-27 19:43 ` [PATCH 2/2] drm/amdgpu: Dirty cleared blocks on allocation Natalie Vock
  0 siblings, 2 replies; 10+ messages in thread
From: Natalie Vock @ 2025-05-27 19:43 UTC (permalink / raw)
  To: amd-gfx, dri-devel
  Cc: Christian König, Alex Deucher, David Airlie, Simona Vetter,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	Arunpravin Paneer Selvam, Natalie Vock

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


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2025-05-29  7:05 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-27 19:43 [PATCH 0/2] Fix AMDGPU VRAM zeroing Natalie Vock
2025-05-27 19:43 ` [PATCH 1/2] drm/buddy: Add public helper to dirty blocks Natalie Vock
2025-05-29  7:05   ` Paneer Selvam, Arunpravin
2025-05-27 19:43 ` [PATCH 2/2] drm/amdgpu: Dirty cleared blocks on allocation Natalie Vock
2025-05-28  7:07   ` Christian König
2025-05-28  9:29     ` Natalie Vock
2025-05-28 10:52       ` Christian König
2025-05-28 12:14       ` Paneer Selvam, Arunpravin
2025-05-28 12:39         ` Michel Dänzer
2025-05-28 12:59           ` Christian König

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).