aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/i915_gem_execbuffer.c
diff options
context:
space:
mode:
authorJP Abgrall <jpa@google.com>2012-05-08 16:49:25 -0700
committerJP Abgrall <jpa@google.com>2012-05-08 16:49:25 -0700
commit36c97064196c4549f7f5353fdce970d62b4795f9 (patch)
treeac39335466302c267a5485232da7c1df13e2a76b /drivers/gpu/drm/i915/i915_gem_execbuffer.c
parent11e410cc6d1483328839cd3df8b554299e86aede (diff)
parent52f91d889a2c2a0f9e0b5e97fa7be8b584834016 (diff)
downloadkernel_samsung_crespo-36c97064196c4549f7f5353fdce970d62b4795f9.zip
kernel_samsung_crespo-36c97064196c4549f7f5353fdce970d62b4795f9.tar.gz
kernel_samsung_crespo-36c97064196c4549f7f5353fdce970d62b4795f9.tar.bz2
Merge remote-tracking branch 'common/android-3.0' into android-samsung-30-wip-mergedown
* common/android-3.0: (49 commits) Linux 3.0.31 hfsplus: Fix potential buffer overflows sched: Fix nohz load accounting -- again! wl1251: fix crash on remove due to leftover work item wl1251: fix crash on remove due to premature kfree rtlwifi: Fix oops on unload mac80211: fix AP mode EAP tx for VLAN stations ipw2200: Fix race condition in the command completion acknowledge i2c: pnx: Disable clk in suspend libata: skip old error history when counting probe trials hwmon: (coretemp) fix oops on cpu unplug hwmon: (coretemp) Increase CPU core limit efivars: Improve variable validation efi: Validate UEFI boot variables efivars: fix warnings when CONFIG_PSTORE=n efivars: String functions efi: Add new variable attributes SCSI: libsas: fix false positive 'device attached' conditions SCSI: libsas: fix sas_find_bcast_phy() in the presence of 'vacant' phys ARM: 7403/1: tls: remove covert channel via TPIDRURW ...
Diffstat (limited to 'drivers/gpu/drm/i915/i915_gem_execbuffer.c')
-rw-r--r--drivers/gpu/drm/i915/i915_gem_execbuffer.c8
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;
}