Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/amdkfd: Clear VRAM on allocation to prevent stale data exposure

KFD VRAM allocations set AMDGPU_GEM_CREATE_VRAM_WIPE_ON_RELEASE
but not AMDGPU_GEM_CREATE_VRAM_CLEARED, leaving freshly allocated
VRAM with stale data from prior use observable by compute kernels.

The GEM ioctl path already sets VRAM_CLEARED for all userspace
allocations via amdgpu_gem_create_ioctl() and
amdgpu_mode_dumb_create(). The KFD path was missing this flag,
allowing stale page table remnants to leak into user buffers.

This causes crashes in RCCL P2P transport where non-zero data in
ptrExchange/head/tail fields corrupts the protocol handshake.

Signed-off-by: Amir Shetaia <Amir.Shetaia@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org

authored by

Amir Shetaia and committed by
Alex Deucher
ad52d61d 08cdf07b

+2 -1
+2 -1
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
··· 1735 1735 alloc_domain = AMDGPU_GEM_DOMAIN_GTT; 1736 1736 alloc_flags = 0; 1737 1737 } else { 1738 - alloc_flags = AMDGPU_GEM_CREATE_VRAM_WIPE_ON_RELEASE; 1738 + alloc_flags = AMDGPU_GEM_CREATE_VRAM_WIPE_ON_RELEASE | 1739 + AMDGPU_GEM_CREATE_VRAM_CLEARED; 1739 1740 alloc_flags |= (flags & KFD_IOC_ALLOC_MEM_FLAGS_PUBLIC) ? 1740 1741 AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED : 0; 1741 1742