* [PATCH] drm/i915/userptr: reject zero user_size
@ 2018-09-02 21:55 Loic
2018-09-03 16:17 ` Greg KH
0 siblings, 1 reply; 9+ messages in thread
From: Loic @ 2018-09-02 21:55 UTC (permalink / raw)
To: stable; +Cc: matthew.auld
Hello,
Tested without any problem so please picked up this.
From: Matthew Auld
[ Upstream commit c11c7bfd213495784b22ef82a69b6489f8d0092f ]
Operating on a zero sized GEM userptr object will lead to explosions.
Fixes: 5cc9ed4b9a7a ("drm/i915: Introduce mapping of user pages into
video memory (userptr) ioctl")
Testcase: igt/gem_userptr_blits/input-checking
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Link:
https://patchwork.freedesktop.org/patch/msgid/20180502195021.30900-1-matthew.auld@intel.com
---
drivers/gpu/drm/i915/i915_gem_userptr.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/gpu/drm/i915/i915_gem_userptr.c
b/drivers/gpu/drm/i915/i915_gem_userptr.c
index d596a8302ca3c..854bd51b9478a 100644
--- a/drivers/gpu/drm/i915/i915_gem_userptr.c
+++ b/drivers/gpu/drm/i915/i915_gem_userptr.c
@@ -778,6 +778,9 @@ i915_gem_userptr_ioctl(struct drm_device *dev,
I915_USERPTR_UNSYNCHRONIZED))
return -EINVAL;
+ if (!args->user_size)
+ return -EINVAL;
+
if (offset_in_page(args->user_ptr | args->user_size))
return -EINVAL;
--
2.17.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH] drm/i915/userptr: reject zero user_size
2018-09-02 21:55 [PATCH] drm/i915/userptr: reject zero user_size Loic
@ 2018-09-03 16:17 ` Greg KH
2018-09-03 19:56 ` Loic
0 siblings, 1 reply; 9+ messages in thread
From: Greg KH @ 2018-09-03 16:17 UTC (permalink / raw)
To: Loic; +Cc: stable, matthew.auld
On Sun, Sep 02, 2018 at 11:55:52PM +0200, Loic wrote:
> Hello,
>
> Tested without any problem so please picked up this.
Pick this up for what stable kernel tree(s) exactly?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] drm/i915/userptr: reject zero user_size
2018-09-03 16:17 ` Greg KH
@ 2018-09-03 19:56 ` Loic
2018-09-07 9:01 ` Greg KH
0 siblings, 1 reply; 9+ messages in thread
From: Loic @ 2018-09-03 19:56 UTC (permalink / raw)
To: Greg KH; +Cc: stable, matthew.auld
Le 2018-09-03 18:17, Greg KH a écrit :
> On Sun, Sep 02, 2018 at 11:55:52PM +0200, Loic wrote:
>> Hello,
>>
>> Tested without any problem so please picked up this.
>
> Pick this up for what stable kernel tree(s) exactly?
Sorry about the lack of detail For 4.4, 4.9 and 4.14 please.
> thanks,
Thanks to you too.
>
> greg k-h
--
Best regards,
Loic
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] drm/i915/userptr: reject zero user_size
2018-09-03 19:56 ` Loic
@ 2018-09-07 9:01 ` Greg KH
0 siblings, 0 replies; 9+ messages in thread
From: Greg KH @ 2018-09-07 9:01 UTC (permalink / raw)
To: Loic; +Cc: stable, matthew.auld
On Mon, Sep 03, 2018 at 09:56:42PM +0200, Loic wrote:
> Le 2018-09-03 18:17, Greg KH a �crit�:
> > On Sun, Sep 02, 2018 at 11:55:52PM +0200, Loic wrote:
> > > Hello,
> > >
> > > Tested without any problem so please picked up this.
> >
> > Pick this up for what stable kernel tree(s) exactly?
>
> Sorry about the lack of detail For 4.4, 4.9 and 4.14 please.
Now queued up, thanks.
greg k-h
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] drm/i915/userptr: reject zero user_size
2018-05-02 19:50 ` Matthew Auld
@ 2018-05-08 11:25 ` Chris Wilson
0 siblings, 0 replies; 9+ messages in thread
From: Chris Wilson @ 2018-05-08 11:25 UTC (permalink / raw)
To: Matthew Auld, intel-gfx
Quoting Matthew Auld (2018-05-02 20:50:21)
> Operating on a zero sized GEM userptr object will lead to explosions.
>
> Fixes: 5cc9ed4b9a7a ("drm/i915: Introduce mapping of user pages into video memory (userptr) ioctl")
> Testcase: igt/gem_userptr_blits/input-checking
> Signed-off-by: Matthew Auld <matthew.auld@intel.com>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Picked up for pushing in the next wave. Thanks for the fix and testcase,
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH] drm/i915/userptr: reject zero user_size
2018-05-02 18:16 Matthew Auld
2018-05-02 18:45 ` Chris Wilson
2018-05-02 18:53 ` Chris Wilson
@ 2018-05-02 19:50 ` Matthew Auld
2018-05-08 11:25 ` Chris Wilson
2 siblings, 1 reply; 9+ messages in thread
From: Matthew Auld @ 2018-05-02 19:50 UTC (permalink / raw)
To: intel-gfx
Operating on a zero sized GEM userptr object will lead to explosions.
Fixes: 5cc9ed4b9a7a ("drm/i915: Introduce mapping of user pages into video memory (userptr) ioctl")
Testcase: igt/gem_userptr_blits/input-checking
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
---
drivers/gpu/drm/i915/i915_gem_userptr.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/gpu/drm/i915/i915_gem_userptr.c b/drivers/gpu/drm/i915/i915_gem_userptr.c
index d596a8302ca3..854bd51b9478 100644
--- a/drivers/gpu/drm/i915/i915_gem_userptr.c
+++ b/drivers/gpu/drm/i915/i915_gem_userptr.c
@@ -778,6 +778,9 @@ i915_gem_userptr_ioctl(struct drm_device *dev,
I915_USERPTR_UNSYNCHRONIZED))
return -EINVAL;
+ if (!args->user_size)
+ return -EINVAL;
+
if (offset_in_page(args->user_ptr | args->user_size))
return -EINVAL;
--
2.17.0
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH] drm/i915/userptr: reject zero user_size
2018-05-02 18:16 Matthew Auld
2018-05-02 18:45 ` Chris Wilson
@ 2018-05-02 18:53 ` Chris Wilson
2018-05-02 19:50 ` Matthew Auld
2 siblings, 0 replies; 9+ messages in thread
From: Chris Wilson @ 2018-05-02 18:53 UTC (permalink / raw)
To: Matthew Auld, intel-gfx
Quoting Matthew Auld (2018-05-02 19:16:17)
> Operating on a zero sized GEM userptr object will lead to explosions.
>
> Fixes: 5cc9ed4b9a7a ("drm/i915: Introduce mapping of user pages into video memory (userptr) ioctl")
> Signed-off-by: Matthew Auld <matthew.auld@intel.com>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
One thing missing for a user visible bug...
Testcase:
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] drm/i915/userptr: reject zero user_size
2018-05-02 18:16 Matthew Auld
@ 2018-05-02 18:45 ` Chris Wilson
2018-05-02 18:53 ` Chris Wilson
2018-05-02 19:50 ` Matthew Auld
2 siblings, 0 replies; 9+ messages in thread
From: Chris Wilson @ 2018-05-02 18:45 UTC (permalink / raw)
To: Matthew Auld, intel-gfx
Quoting Matthew Auld (2018-05-02 19:16:17)
> Operating on a zero sized GEM userptr object will lead to explosions.
>
> Fixes: 5cc9ed4b9a7a ("drm/i915: Introduce mapping of user pages into video memory (userptr) ioctl")
> Signed-off-by: Matthew Auld <matthew.auld@intel.com>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
I could find no "but..." to save the day, so yes, it does look like we
would let a 0 sized object through to the guts that never expect to see
such a thing.
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH] drm/i915/userptr: reject zero user_size
@ 2018-05-02 18:16 Matthew Auld
2018-05-02 18:45 ` Chris Wilson
` (2 more replies)
0 siblings, 3 replies; 9+ messages in thread
From: Matthew Auld @ 2018-05-02 18:16 UTC (permalink / raw)
To: intel-gfx
Operating on a zero sized GEM userptr object will lead to explosions.
Fixes: 5cc9ed4b9a7a ("drm/i915: Introduce mapping of user pages into video memory (userptr) ioctl")
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
---
drivers/gpu/drm/i915/i915_gem_userptr.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/gpu/drm/i915/i915_gem_userptr.c b/drivers/gpu/drm/i915/i915_gem_userptr.c
index d596a8302ca3..854bd51b9478 100644
--- a/drivers/gpu/drm/i915/i915_gem_userptr.c
+++ b/drivers/gpu/drm/i915/i915_gem_userptr.c
@@ -778,6 +778,9 @@ i915_gem_userptr_ioctl(struct drm_device *dev,
I915_USERPTR_UNSYNCHRONIZED))
return -EINVAL;
+ if (!args->user_size)
+ return -EINVAL;
+
if (offset_in_page(args->user_ptr | args->user_size))
return -EINVAL;
--
2.17.0
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 9+ messages in thread
end of thread, other threads:[~2018-09-07 13:42 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-02 21:55 [PATCH] drm/i915/userptr: reject zero user_size Loic
2018-09-03 16:17 ` Greg KH
2018-09-03 19:56 ` Loic
2018-09-07 9:01 ` Greg KH
-- strict thread matches above, loose matches on Subject: below --
2018-05-02 18:16 Matthew Auld
2018-05-02 18:45 ` Chris Wilson
2018-05-02 18:53 ` Chris Wilson
2018-05-02 19:50 ` Matthew Auld
2018-05-08 11:25 ` Chris Wilson
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.