[Intel-gfx] [PATCH 2/2] drm/i915: Handle validation of relocation object with length >=2GB

Sagar Arun Kamble sagar.a.kamble at intel.com
Mon Feb 13 06:44:15 UTC 2017


From: "sagar.a.kamble at intel.com" <sagar.a.kamble at intel.com>

With prefaulting extended to support >=2GB, i915 can handle
relocation objects >=2GB. type conversion of length from int to
unsigned long in access_ok was making the validation bail out with
-EFAULT.

Testcase: igt/gem_exec_reloc/wc-31
Cc: Daniel Vetter <daniel.vetter at ffwll.ch>
Cc: Chris Wilson <chris at chris-wilson.co.uk>
Signed-off-by: Sagar Arun Kamble <sagar.a.kamble at intel.com>
---
 drivers/gpu/drm/i915/i915_gem_execbuffer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
index 111b7f8..53a8cc7 100644
--- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c
+++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
@@ -1172,7 +1172,7 @@ static bool only_mappable_for_reloc(unsigned int flags)
 
 	for (i = 0; i < count; i++) {
 		char __user *ptr = u64_to_user_ptr(exec[i].relocs_ptr);
-		int length; /* limited by fault_in_pages_readable() */
+		unsigned long length;
 
 		if (exec[i].flags & invalid_flags)
 			return -EINVAL;
-- 
1.9.1



More information about the Intel-gfx mailing list