The patch titled
Subject: drm/i915: fix integer overflow in i915_gem_do_execbuffer()
has been added to the -mm tree. Its filename is
drm-i915-fix-integer-overflow-in-i915_gem_do_execbuffer.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 <[email protected]>
Subject: drm/i915: fix integer overflow in i915_gem_do_execbuffer()
On 32-bit systems, a large args->num_cliprects from userspace via ioctl
may overflow the allocation size, leading to out-of-bounds access.
This vulnerability was introduced in commit 432e58ed ("drm/i915: Avoid
allocation for execbuffer object list").
Signed-off-by: Xi Wang <[email protected]>
Reviewed-by: Chris Wilson <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
---
drivers/gpu/drm/i915/i915_gem_execbuffer.c | 5 +++++
1 file changed, 5 insertions(+)
diff -puN
drivers/gpu/drm/i915/i915_gem_execbuffer.c~drm-i915-fix-integer-overflow-in-i915_gem_do_execbuffer
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_do_execbuffer
+++ a/drivers/gpu/drm/i915/i915_gem_execbuffer.c
@@ -1175,6 +1175,11 @@ i915_gem_do_execbuffer(struct drm_device
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) {
_
Subject: Subject: drm/i915: fix integer overflow in i915_gem_do_execbuffer()
Patches currently in -mm which might be from [email protected] 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 stable" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html