videobuf2-core: Check user space planes array in dqbuf
authorSakari Ailus <sakari.ailus@linux.intel.com>
Sun, 3 Apr 2016 19:15:00 +0000 (16:15 -0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 4 May 2016 21:48:50 +0000 (14:48 -0700)
commit3a4b3d187dba0255cbbb749f64c3b71f8105f44f
tree0ebb1d3ea387e264e6baf9d2592d2e4702b8da41
parent4a1bb501e4b65908b102f0b371b0621ff18ad5c3
videobuf2-core: Check user space planes array in dqbuf

commit e7e0c3e26587749b62d17b9dd0532874186c77f7 upstream.

The number of planes in videobuf2 is specific to a buffer. In order to
verify that the planes array provided by the user is long enough, a new
vb2_buf_op is required.

Call __verify_planes_array() when the dequeued buffer is known. Return an
error to the caller if there was one, otherwise remove the buffer from the
done list.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/media/v4l2-core/videobuf2-core.c
include/media/videobuf2-core.h