Prev: [patch 131/164] sctp: Fix skb_over_panic resulting from multiple invalid parameter errors (CVE-2010-1173) (v4)
Next: [patch 089/164] drm/radeon: r100/r200 ums: block ability for userspace app to trash 0 page and beyond
From: Greg KH on 1 Jul 2010 17:00 2.6.33-stable review patch. If anyone has any objections, please let me know. ------------------ From: Chris Wilson <chris(a)chris-wilson.co.uk> commit 654fc6073f68efa3b6c466825749e73e7fbb92cd upstream. If the object is bigger than the entire aperture, reject it early before evicting everything in a vain attempt to find space. v2: Use E2BIG as suggested by Owain G. Ainsworth. Signed-off-by: Chris Wilson <chris(a)chris-wilson.co.uk> Signed-off-by: Eric Anholt <eric(a)anholt.net> Signed-off-by: Greg Kroah-Hartman <gregkh(a)suse.de> --- drivers/gpu/drm/i915/i915_gem.c | 8 ++++++++ 1 file changed, 8 insertions(+) --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c @@ -2641,6 +2641,14 @@ i915_gem_object_bind_to_gtt(struct drm_g return -EINVAL; } + /* If the object is bigger than the entire aperture, reject it early + * before evicting everything in a vain attempt to find space. + */ + if (obj->size > dev->gtt_total) { + DRM_ERROR("Attempting to bind an object larger than the aperture\n"); + return -E2BIG; + } + search_free: free_space = drm_mm_search_free(&dev_priv->mm.gtt_space, obj->size, alignment, 0); -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ |