Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-gfx] [PATCH] drm/i915/gem: Add a check for object size for corner cases
@ 2021-02-10  7:59 Anand Moon
  2021-02-10  8:49 ` [Intel-gfx] ✓ Fi.CI.BAT: success for " Patchwork
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Anand Moon @ 2021-02-10  7:59 UTC (permalink / raw)
  To: intel-gfx, dri-devel, Chris Wilson, Matthew Auld, Tvrtko Ursulin,
	Jani Nikula, Tejas Upadhyay
  Cc: Anand Moon

Add check for object size to return appropriate error -E2BIG or -EINVAL
to avoid WARM_ON and sucessfull return for some testcase.

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Matthew Auld <matthew.auld@intel.com>
Signed-off-by: Anand Moon <anandx.ram.moon@intel.com>
---
VLK-17702: Since these object size is U64 these corner case will not come
into real test senario.

IGT testcase:
sudo ./gem_create --r create-massive
sudo ./gem_userptr_blits --r input-checking
---
 drivers/gpu/drm/i915/gem/i915_gem_object.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/i915/gem/i915_gem_object.h b/drivers/gpu/drm/i915/gem/i915_gem_object.h
index 366d23afbb1a..afc37546da20 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_object.h
+++ b/drivers/gpu/drm/i915/gem/i915_gem_object.h
@@ -33,6 +33,9 @@ static inline bool i915_gem_object_size_2big(u64 size)
 {
 	struct drm_i915_gem_object *obj;
 
+	if (size == -1 || size == (-1ull << 32))
+		return true;
+
 	if (GEM_CHECK_SIZE_OVERFLOW(size))
 		return true;
 
-- 
2.30.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:[~2021-02-16 12:07 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-02-10  7:59 [Intel-gfx] [PATCH] drm/i915/gem: Add a check for object size for corner cases Anand Moon
2021-02-10  8:49 ` [Intel-gfx] ✓ Fi.CI.BAT: success for " Patchwork
2021-02-10 10:45 ` [Intel-gfx] [PATCH] " Chris Wilson
2021-02-15 12:29   ` Ram Moon, AnandX
2021-02-15 12:39     ` Chris Wilson
2021-02-16 12:05       ` Ram Moon, AnandX
2021-02-16 12:07         ` Chris Wilson
2021-02-10 11:05 ` [Intel-gfx] ✓ Fi.CI.IGT: success for " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox