[Intel-gfx] [PATCH] drm/i915: Sanity check the computed size and base of stolen memory

Joonas Lahtinen joonas.lahtinen at linux.intel.com
Mon Jan 30 13:45:55 UTC 2017


On ma, 2017-01-30 at 13:15 +0000, Chris Wilson wrote:
> 
> if (base == 0 || range_overflows(base, ggtt->stolen_size, U64_MAX /* DMA_ADDR_MAX */))
> 
> Bleh.
> 
> #define add_overflows(A, B) __builtin_add_overflow_p((A), (B), (typeof((A) + (B)))0)
> 
> if (base == 0 || add_overflows(base, ggtt->stolen_size))

Looks good.

Regards, Joonas
-- 
Joonas Lahtinen
Open Source Technology Center
Intel Corporation


More information about the Intel-gfx mailing list