The patch titled Subject: drm/i915: fix integer overflow in i915_gem_execbuffer2() has been added to the -mm tree. Its filename is drm-i915-fix-integer-overflow-in-i915_gem_execbuffer2.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Xi Wang <xi.wang@xxxxxxxxx> Subject: drm/i915: fix integer overflow in i915_gem_execbuffer2() On 32-bit systems, a large args->buffer_count from userspace via ioctl may overflow the allocation size, leading to out-of-bounds access. This vulnerability was introduced in commit 8408c282 ("drm/i915: First try a normal large kmalloc for the temporary exec buffers"). Signed-off-by: Xi Wang <xi.wang@xxxxxxxxx> Reviewed-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx> Cc: <stable@xxxxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- drivers/gpu/drm/i915/i915_gem_execbuffer.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff -puN drivers/gpu/drm/i915/i915_gem_execbuffer.c~drm-i915-fix-integer-overflow-in-i915_gem_execbuffer2 drivers/gpu/drm/i915/i915_gem_execbuffer.c --- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c~drm-i915-fix-integer-overflow-in-i915_gem_execbuffer2 +++ a/drivers/gpu/drm/i915/i915_gem_execbuffer.c @@ -1446,7 +1446,8 @@ i915_gem_execbuffer2(struct drm_device * 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_DEBUG("execbuf2 with %d buffers\n", args->buffer_count); return -EINVAL; } _ Subject: Subject: drm/i915: fix integer overflow in i915_gem_execbuffer2() Patches currently in -mm which might be from xi.wang@xxxxxxxxx are linux-next.patch drm-i915-fix-integer-overflow-in-i915_gem_execbuffer2.patch drm-i915-fix-integer-overflow-in-i915_gem_do_execbuffer.patch codingstyle-add-kmalloc_array-to-memory-allocators.patch introduce-size_max.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html