mirror of
https://github.com/armbian/linux.git
synced 2026-01-06 10:13:00 -08:00
drm/i915: fix integer overflow in i915_gem_execbuffer2()
commited8cd3b2cdupstream. 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 commit8408c282("drm/i915: First try a normal large kmalloc for the temporary exec buffers"). Signed-off-by: Xi Wang <xi.wang@gmail.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
8c9def922a
commit
fb247af4cc
@@ -1296,7 +1296,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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user