]> git.baikalelectronics.ru Git - kernel.git/commit
media: v4l: ioctl: Validate num_planes before using it
authorSakari Ailus <sakari.ailus@linux.intel.com>
Thu, 10 Jan 2019 12:43:19 +0000 (07:43 -0500)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Wed, 16 Jan 2019 16:12:10 +0000 (11:12 -0500)
commitacf0ff15c3349e36794c70a4dc9e2d9f2049ea38
treeb2db22dae3e4800d48dffe3303ae09e97c7ac70b
parent05b1d8dacc0bb6860673b9a3bff733042f255061
media: v4l: ioctl: Validate num_planes before using it

The for loop to reset the memory of the plane reserved fields runs over
num_planes provided by the user without validating it. Ensure num_planes
is no more than VIDEO_MAX_PLANES before the loop.

Fixes: 51abed133e54 ("media: v4l2-ioctl: Zero v4l2_plane_pix_format reserved fields")
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/v4l2-core/v4l2-ioctl.c