]> git.baikalelectronics.ru Git - kernel.git/commit
vmwgfx: integer overflow in vmw_kms_update_layout_ioctl()
authorXi Wang <xi.wang@gmail.com>
Mon, 28 Nov 2011 11:25:43 +0000 (12:25 +0100)
committerDave Airlie <airlied@redhat.com>
Fri, 2 Dec 2011 10:49:41 +0000 (10:49 +0000)
commit67e0a436106ea749584ef3165c7b26a1763c1aa9
tree7413fe6517587d631fca96960ec806d5e8b7e61a
parent8e6bbd82888b66c9b6ae412c789d7c6e432188ac
vmwgfx: integer overflow in vmw_kms_update_layout_ioctl()

There are two issues in vmw_kms_update_layout_ioctl().  First, the
for loop forgets to index rects and only checks the first element.
Second, there is a potential integer overflow if userspace passes
in a large arg->num_outputs.  The call to kzalloc() would allocate
a small buffer, leading to out-of-bounds read.

Reported-by: Haogang Chen <haogangchen@gmail.com>
Signed-off-by: Xi Wang <xi.wang@gmail.com>
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/vmwgfx/vmwgfx_kms.c