All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915/userptr: reject zero user_size
@ 2018-05-02 18:16 Matthew Auld
  2018-05-02 18:45 ` Chris Wilson
                   ` (5 more replies)
  0 siblings, 6 replies; 8+ 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] 8+ messages in thread

end of thread, other threads:[~2018-05-08 11:25 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-02 18:16 [PATCH] drm/i915/userptr: reject zero user_size Matthew Auld
2018-05-02 18:45 ` Chris Wilson
2018-05-02 18:52 ` ✓ Fi.CI.BAT: success for " Patchwork
2018-05-02 18:53 ` [PATCH] " Chris Wilson
2018-05-02 19:50 ` Matthew Auld
2018-05-08 11:25   ` Chris Wilson
2018-05-02 20:38 ` ✓ Fi.CI.BAT: success for drm/i915/userptr: reject zero user_size (rev2) Patchwork
2018-05-03  3:33 ` ✓ Fi.CI.IGT: " Patchwork

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.