media: v4l2-compat-ioctl32: prevent go past max size
commit77edeac403e686fef51b8a2344223c98c2f90d8e
authorMauro Carvalho Chehab <mchehab@s-opensource.com>
Wed, 11 Apr 2018 15:47:32 +0000 (11 11:47 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 3 Jul 2018 09:18:48 +0000 (3 11:18 +0200)
tree55dcd90082f265071456d3c749fe9f53d20a8c40
parent8d2e0fa5a92a0b337b87651f4fa1119dbd96051f
media: v4l2-compat-ioctl32: prevent go past max size

commit ea72fbf588ac9c017224dcdaa2019ff52ca56fee upstream.

As warned by smatch:
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:879 put_v4l2_ext_controls32() warn: check for integer overflow 'count'

The access_ok() logic should check for too big arrays too.

Cc: stable@vger.kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/media/v4l2-core/v4l2-compat-ioctl32.c