diff options
author | Todd Poynor <toddpoynor@google.com> | 2012-05-08 11:36:40 -0700 |
---|---|---|
committer | Todd Poynor <toddpoynor@google.com> | 2012-05-08 11:36:40 -0700 |
commit | 52f91d889a2c2a0f9e0b5e97fa7be8b584834016 (patch) | |
tree | e9c820e826581e430c53f523651fc9e2465a4b37 /drivers/gpu/drm/i915/i915_gem_execbuffer.c | |
parent | 434b9914eec503fc0eaaa52908765bca6430d22b (diff) | |
parent | bea37381fd9a34c6660e5195d31beea86aa3dda3 (diff) | |
download | kernel_samsung_aries-52f91d889a2c2a0f9e0b5e97fa7be8b584834016.zip kernel_samsung_aries-52f91d889a2c2a0f9e0b5e97fa7be8b584834016.tar.gz kernel_samsung_aries-52f91d889a2c2a0f9e0b5e97fa7be8b584834016.tar.bz2 |
Merge commit 'v3.0.31' into android-3.0
Diffstat (limited to 'drivers/gpu/drm/i915/i915_gem_execbuffer.c')
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem_execbuffer.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c index 4934cf8..bc927ae 100644 --- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c +++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c @@ -1046,6 +1046,11 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data, return -EINVAL; } + if (args->num_cliprects > UINT_MAX / sizeof(*cliprects)) { + DRM_DEBUG("execbuf with %u cliprects\n", + args->num_cliprects); + return -EINVAL; + } cliprects = kmalloc(args->num_cliprects * sizeof(*cliprects), GFP_KERNEL); if (cliprects == NULL) { @@ -1296,7 +1301,8 @@ i915_gem_execbuffer2(struct drm_device *dev, void *data, struct drm_i915_gem_exec_object2 *exec2_list = NULL; int ret; - if (args->buffer_count < 1) { + if (args->buffer_count < 1 || + args->buffer_count > UINT_MAX / sizeof(*exec2_list)) { DRM_ERROR("execbuf2 with %d buffers\n", args->buffer_count); return -EINVAL; } |