Skip to content

Commit 98f1348

Browse files
Jonathan-Cavittintel-lab-lkp
authored andcommitted
drm/xe/xe_pagefault: Disallow writes to read-only VMAs
The page fault handler should reject write/atomic access to read only VMAs. Add code to handle this in xe_pagefault_service after the VMA lookup. v2: - Apply max line length (Matthew) Fixes: fb544b8 ("drm/xe: Implement xe_pagefault_queue_work") Signed-off-by: Jonathan Cavitt <jonathan.cavitt@intel.com> Suggested-by: Matthew Brost <matthew.brost@intel.com> Cc: Shuicheng Lin <shuicheng.lin@intel.com> Reviewed-by: Matthew Brost <matthew.brost@intel.com>
1 parent 737ec1e commit 98f1348

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

drivers/gpu/drm/xe/xe_pagefault.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,12 @@ static int xe_pagefault_service(struct xe_pagefault *pf)
187187
goto unlock_vm;
188188
}
189189

190+
if (xe_vma_read_only(vma) &&
191+
pf->consumer.access_type != XE_PAGEFAULT_ACCESS_TYPE_READ) {
192+
err = -EPERM;
193+
goto unlock_vm;
194+
}
195+
190196
atomic = xe_pagefault_access_is_atomic(pf->consumer.access_type);
191197

192198
if (xe_vma_is_cpu_addr_mirror(vma))

0 commit comments

Comments
 (0)