All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sagar Arun Kamble <sagar.a.kamble@intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Subject: [PATCH 2/2] drm/i915: Handle validation of relocation object with length >=2GB
Date: Mon, 13 Feb 2017 12:14:15 +0530	[thread overview]
Message-ID: <1486968255-2329-2-git-send-email-sagar.a.kamble@intel.com> (raw)
In-Reply-To: <1486968255-2329-1-git-send-email-sagar.a.kamble@intel.com>

From: "sagar.a.kamble@intel.com" <sagar.a.kamble@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@ffwll.ch>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Sagar Arun Kamble <sagar.a.kamble@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

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2017-02-13  6:41 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-13  6:44 [PATCH 1/2] mm: Handle prefault for size >= 2GB Sagar Arun Kamble
2017-02-13  6:44 ` Sagar Arun Kamble [this message]
2017-02-13 10:58   ` [PATCH 2/2] drm/i915: Handle validation of relocation object with length >=2GB Joonas Lahtinen
2017-02-13 11:02     ` Chris Wilson
2017-02-13 12:25       ` Joonas Lahtinen
2017-02-13 12:33         ` Chris Wilson
2017-02-13 16:05           ` Kamble, Sagar A
2017-02-13  7:21 ` ✓ Fi.CI.BAT: success for series starting with [1/2] mm: Handle prefault for size >= 2GB Patchwork
2017-02-13 10:48 ` [PATCH 1/2] " Joonas Lahtinen
2017-02-13 10:58   ` Joonas Lahtinen
2017-02-13 15:53   ` Kamble, Sagar A

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1486968255-2329-2-git-send-email-sagar.a.kamble@intel.com \
    --to=sagar.a.kamble@intel.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.