media: v4l2-compat-ioctl32: prevent go past max size
authorMauro Carvalho Chehab <mchehab@s-opensource.com>
Wed, 11 Apr 2018 15:47:32 +0000 (11:47 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 3 Jul 2018 09:23:15 +0000 (11:23 +0200)
commit1e6b50b6b68e25a8ff972a1e1279a40cd7adc4fd
tree2d2460943c051a809ec5894df167cbb1031962ac
parentd6a267b4c5f9bb3db42e3fe6092d1059f08d03bf
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