Commit 14b482c98dfe for kernel
commit 14b482c98dfe9683b12338561a6e9bd44f7337a9
Author: Linus Torvalds <torvalds@linux-foundation.org>
Date: Wed Oct 21 07:13:59 2026 -1000
drm/i915/gem: ignore errors on presumed_offset write-back
It appears that the crazy "don't check for errors" code in the i915
relocation code was intentional, but not visible in the code as such.
See commit 97a37c919f62 ("drm/i915/gem: Ignore readonly failures when
updating relocs"). Quoting that commit:
"Be damned if you do, and damned if you don't."
So disable the error check again, but leave it around visibly for
posterity as documentation for why it's not there.
Fixes: 03c19e449ac6 ("drm/i915/gem: Don't fault on presumed_offset write-back")
Reported-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
diff --git a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
index 8ed5aa3beae3..1b7f5bf13e50 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
@@ -1586,7 +1586,16 @@ static int eb_relocate_vma(struct i915_execbuffer *eb, struct eb_vma *ev)
pagefault_disable();
err = put_user(offset, &urelocs[r - stack].presumed_offset);
pagefault_enable();
- if (unlikely(err)) {
+
+ /*
+ * Error handling is disabled on purpose. No, it makes
+ * no sense, and the code will loop over the relocations
+ * without writing them back and just waste CPU time,
+ * but that's apparently what the mprotect test-cases
+ * want. See commit 97a37c919f62 ("drm/i915/gem: Ignore
+ * readonly failures when updating relocs")
+ */
+ if (unlikely(err) && 0) {
remain = -EFAULT;
goto out;
}