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:25:02 +0000 (11:25 +0200)
commit06b846486668e1de1d350f8adc86c3d36f01a4ac
treead1012a24490c5cf9df903e79045fd5d1c175a96
parentb28f53169c0f4947f6745a993fe655c7c7a9ff8a
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