[PATCH v6 0/2] drm/i915/selftests: Use safe userspace memory for mappings

Krzysztof Karas
2026-04-15T09:21:30Z

Test-with: 20260330102400.1157658-1-krzysztof.karas@intel.com

Currently, i915 selftests use unknown process's address space to
perform mappings to userspace memory. This is problematic,
because there is no control over lifetime of the memory of such
task, so the test would occasionally borrow memory scheduled for
or in the middle of a cleanup causing SIGBUS errors.

Utilize user-provided PID of running userspace process to
perfofm mapping in a safe environment.

v4:
* Rearrange the code in patches. (Janusz)

v5:
* Move missing requirement warning to the test. (Janusz)

v6:
* Move mm handling to new function (Andi).
* Add checks for validity of user PID

Krzysztof Karas (2):
drm/i915/selftests: Prevent userspace mapping invalidation
drm/i915/selftests: Run vma tests only if current->mm is present

.../drm/i915/gem/selftests/i915_gem_mman.c | 16 +++---
drivers/gpu/drm/i915/i915_selftest.h | 1 +
.../gpu/drm/i915/selftests/i915_selftest.c | 57 +++++++++++++++++++
3 files changed, 66 insertions(+), 8 deletions(-)

--
2.43.0