V4L/DVB: v4l2-ioctl: integer overflow in video_usercopy()
commit537400450bd43daf3f99efe35efd0ccaf16f38b1
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 5 Jan 2012 05:27:57 +0000 (5 02:27 -0300)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 25 Jan 2012 21:53:21 +0000 (25 13:53 -0800)
tree318eb8b1dabb23a4080f54cfbfc5531b8e0dbf16
parentadafb366fb48fba6384818fa117ac89ce4ea75a8
V4L/DVB: v4l2-ioctl: integer overflow in video_usercopy()

commit 6c06108be53ca5e94d8b0e93883d534dd9079646 upstream.

If ctrls->count is too high the multiplication could overflow and
array_size would be lower than expected.  Mauro and Hans Verkuil
suggested that we cap it at 1024.  That comes from the maximum
number of controls with lots of room for expantion.

$ grep V4L2_CID include/linux/videodev2.h | wc -l
211

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/media/video/v4l2-ioctl.c
include/linux/videodev2.h