On Thu, Sep 19, 2013 at 02:53:36PM +0200, Daniel Vetter wrote: > There's actually no real risk since we already check for stricter > constraints earlier (using UINT_MAX / sizeof (struct > drm_i915_gem_exec_object2) as the limit). But in eb_create we use > signed integers, which steals a factor of 2. Luckily struct > drm_i915_gem_exec_object2 for this to not matter. > > Still, be consistent and use unsigned integers. > > Similar use unsinged integers when checking for overflows in the > relocation entry processing. > > I've also added a new subtests to igt/gem_reloc_overflow to also > test for overflowing args->buffer_count values. > > v2: Give the variables again tighter scope to make it clear that the > computation is purely local and doesn't leak out to the 2nd block. > Requested by Chris Wilson. > > v3: Add a comment why we don't need to recheck for overflows. > > Cc: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx> > Signed-off-by: Daniel Vetter <daniel.vetter@xxxxxxxx> Reviewed-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx> -Chris -- Chris Wilson, Intel Open Source Technology Centre _______________________________________________ Intel-gfx mailing list Intel-gfx@xxxxxxxxxxxxxxxxxxxxx http://lists.freedesktop.org/mailman/listinfo/intel-gfx