From: "Kamble, Sagar A" Subject: Re: [PATCH 2/2] drm/i915: Handle validation of relocation object with length >=2GB Date: Mon, 13 Feb 2017 21:35:02 +0530 Message-ID: <2a59e6c1-014a-b3a9-740b-0ac64b443b5f@intel.com> References: <1486968255-2329-1-git-send-email-sagar.a.kamble@intel.com> <1486968255-2329-2-git-send-email-sagar.a.kamble@intel.com> <1486983537.3223.28.camel@linux.intel.com> <20170213110220.GE30915@nuc-i3427.alporthouse.com> <1486988729.3223.31.camel@linux.intel.com> <20170213123329.GG30915@nuc-i3427.alporthouse.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1298484887==" Return-path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by gabe.freedesktop.org (Postfix) with ESMTPS id 639A06E435 for ; Mon, 13 Feb 2017 16:05:09 +0000 (UTC) In-Reply-To: <20170213123329.GG30915@nuc-i3427.alporthouse.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: Chris Wilson , Joonas Lahtinen , intel-gfx@lists.freedesktop.org, Daniel Vetter List-Id: intel-gfx@lists.freedesktop.org This is a multi-part message in MIME format. --===============1298484887== Content-Type: multipart/alternative; boundary="------------7C525D415B75A7E904675D37" This is a multi-part message in MIME format. --------------7C525D415B75A7E904675D37 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit On 2/13/2017 6:03 PM, Chris Wilson wrote: > On Mon, Feb 13, 2017 at 02:25:29PM +0200, Joonas Lahtinen wrote: >> On ma, 2017-02-13 at 11:02 +0000, Chris Wilson wrote: >>> On Mon, Feb 13, 2017 at 12:58:57PM +0200, Joonas Lahtinen wrote: >>>> On ma, 2017-02-13 at 12:14 +0530, Sagar Arun Kamble wrote: >>>>> From: "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 >>>>> Cc: Chris Wilson >>>>> Signed-off-by: Sagar Arun Kamble >>>> With the correct "From:" and with "size_t" as type, this is; >>>> >>>> Reviewed-by: Joonas Lahtinen >>> My earlier comments still apply in that this is not how I fixed this >>> years ago, and I still much prefer my fix. >> Where are the earlier comments? I must have missed them. > I replied to the first time this patch landed in my inbox, which might > have been trybotted. > -Chris Chris, I thought those comments were about relocs_total and relocs_max values. Pasting below inputs from trybot. ------------ The abi is limited to 32b max relocs. Please see https://cgit.freedesktop.org/~ickle/linux-2.6/commit/?h=prescheduler&id=bcf3bca07f21a4c0c754ccecca81228c28437906 (a patch that is years overdue) in which this just evaporates. -Chris --------- --------------7C525D415B75A7E904675D37 Content-Type: text/html; charset=windows-1252 Content-Transfer-Encoding: 7bit



On 2/13/2017 6:03 PM, Chris Wilson wrote:
On Mon, Feb 13, 2017 at 02:25:29PM +0200, Joonas Lahtinen wrote:
On ma, 2017-02-13 at 11:02 +0000, Chris Wilson wrote:
On Mon, Feb 13, 2017 at 12:58:57PM +0200, Joonas Lahtinen wrote:
On ma, 2017-02-13 at 12:14 +0530, Sagar Arun Kamble wrote:
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>
With the correct "From:" and with "size_t" as type, this is;

Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
My earlier comments still apply in that this is not how I fixed this
years ago, and I still much prefer my fix.
Where are the earlier comments? I must have missed them.
I replied to the first time this patch landed in my inbox, which might
have been trybotted.
-Chris
Chris, I thought those comments were about relocs_total and relocs_max values.
Pasting below inputs from trybot.
------------
The abi is limited to 32b max relocs.

Please see
https://cgit.freedesktop.org/~ickle/linux-2.6/commit/?h=prescheduler&id=bcf3bca07f21a4c0c754ccecca81228c28437906
(a patch that is years overdue) in which this just evaporates.
-Chris
---------


    

--------------7C525D415B75A7E904675D37-- --===============1298484887== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KSW50ZWwtZ2Z4 IG1haWxpbmcgbGlzdApJbnRlbC1nZnhAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vaW50ZWwtZ2Z4Cg== --===============1298484887==--