]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
drm/gpusvm: Reject VMAs with VM_IO or VM_PFNMAP when creating SVM ranges
authorMatthew Brost <matthew.brost@intel.com>
Wed, 25 Mar 2026 23:16:08 +0000 (16:16 -0700)
committerMatthew Brost <matthew.brost@intel.com>
Thu, 2 Apr 2026 03:45:31 +0000 (20:45 -0700)
commitb82a225e57a334335a21462b75ee2223bc6efe6d
tree2017a6a567107a6a9426306b6e824ed68463f509
parent896070686b16cc45cca7854be2049923b2b303d3
drm/gpusvm: Reject VMAs with VM_IO or VM_PFNMAP when creating SVM ranges

VMAs marked with VM_IO or VM_PFNMAP are not backed by struct page
objects, which GPUSVM requires in order to operate correctly. In
particular, get_pages() relies on hmm_range_fault() to resolve struct
pages for the target range.

Attempting to create an SVM range on such VMAs results in repeated
get_pages() failures and can lead to an infinite loop inside a driver’s
page‑fault handler. Prevent this by rejecting ranges on VM_IO or
VM_PFNMAP VMAs and returning -EIO.

Fixes: 99624bdff867 ("drm/gpusvm: Add support for GPU Shared Virtual Memory")
Signed-off-by: Matthew Brost <matthew.brost@intel.com>
Reviewed-by: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
Link: https://patch.msgid.link/20260325231608.25581-1-matthew.brost@intel.com
drivers/gpu/drm/drm_gpusvm.c