linux-sg2042/drivers/media/v4l2-core
Sakari Ailus 83934b75c3 [media] videobuf2-v4l2: Verify planes array in buffer dequeueing
When a buffer is being dequeued using VIDIOC_DQBUF IOCTL, the exact buffer
which will be dequeued is not known until the buffer has been removed from
the queue. The number of planes is specific to a buffer, not to the queue.

This does lead to the situation where multi-plane buffers may be requested
and queued with n planes, but VIDIOC_DQBUF IOCTL may be passed an argument
struct with fewer planes.

__fill_v4l2_buffer() however uses the number of planes from the dequeued
videobuf2 buffer, overwriting kernel memory (the m.planes array allocated
in video_usercopy() in v4l2-ioctl.c)  if the user provided fewer
planes than the dequeued buffer had. Oops!

Fixes: b0e0e1f83d ("[media] media: videobuf2: Prepare to divide videobuf2")

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Cc: stable@vger.kernel.org # for v4.4 and later
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-06-16 07:35:02 -03:00
..
Kconfig [media] v4l: remove MEDIA_TUNER dependency for VIDEO_TUNER 2016-02-01 13:16:33 -02:00
Makefile [media] v4l2-mc: add a generic function to create the media graph 2016-02-10 07:23:40 -02:00
tuner-core.c [media] v4l2-mc.h Add pads for audio and video IF-PLL decoders 2016-02-01 07:23:58 -02:00
v4l2-async.c [media] v4l2-async: Don't fail if registered_async isn't implemented 2016-02-19 08:10:31 -02:00
v4l2-clk.c [media] v4l2-clk: v4l2_clk_get() also need to find the of_fullname clock 2015-11-17 15:19:52 -02:00
v4l2-common.c [media] v4l2-common: move v4l2_ctrl_check to cx2341x 2014-11-25 08:25:36 -02:00
v4l2-compat-ioctl32.c [media] media: v4l2-compat-ioctl32: fix missing reserved field copy in put_v4l2_create32 2016-04-13 17:08:30 -03:00
v4l2-ctrls.c [media] v4l: add V4L2_CID_MPEG_VIDEO_FORCE_KEY_FRAME 2016-02-19 08:10:35 -02:00
v4l2-dev.c [media] media: Add obj_type field to struct media_entity 2016-04-13 17:20:22 -03:00
v4l2-device.c [media] v4l2-device: fix a missing error code 2016-01-11 12:19:16 -02:00
v4l2-dv-timings.c [media] v4l2-dv-timings: skip standards check for V4L2_DV_BT_CAP_CUSTOM 2016-02-01 08:01:42 -02:00
v4l2-event.c [media] v4l2-event: v4l2_event_queue: do nothing if vdev == NULL 2015-07-17 09:15:27 -03:00
v4l2-fh.c [media] media: Change v4l-core to check if source is free 2016-02-27 08:46:55 -03:00
v4l2-flash-led-class.c media updates for v4.5-rc1 2016-01-13 11:46:37 -08:00
v4l2-ioctl.c [media] v4l2-ioctl.c: improve cropcap compatibility code 2016-05-06 15:43:45 -03:00
v4l2-mc.c Update my main e-mails at the Kernel tree 2016-06-14 14:55:18 -03:00
v4l2-mem2mem.c [media] media: videobuf2: Restructure vb2_buffer 2015-10-01 09:04:43 -03:00
v4l2-of.c [media] v4l: of: Correct v4l2_of_parse_endpoint() kernel-doc 2016-02-01 10:01:22 -02:00
v4l2-subdev.c [media] media: change pipeline validation return error 2016-04-29 08:07:17 -03:00
v4l2-trace.c [media] media: videobuf2: Prepare to divide videobuf2 2015-10-20 15:12:45 -02:00
vb2-trace.c [media] media: videobuf2: Prepare to divide videobuf2 2015-10-20 15:12:45 -02:00
videobuf-core.c [media] V4L: fix a confusing function name 2016-03-03 07:30:43 -03:00
videobuf-dma-contig.c [media] videobuf-dma-contig: set vm_pgoff to be zero to pass the sanity check in vm_iomap_memory() 2014-10-24 09:32:41 -02:00
videobuf-dma-sg.c mm, fs: get rid of PAGE_CACHE_* and page_cache_{get,release} macros 2016-04-04 10:41:08 -07:00
videobuf-dvb.c
videobuf-vmalloc.c [media] Revert "[media] videobuf_vm_{open,close} race fixes" 2014-02-04 06:29:46 -02:00
videobuf2-core.c [media] vb2: core: Skip planes array verification if pb is NULL 2016-06-16 07:34:25 -03:00
videobuf2-dma-contig.c media: vb2-dma-contig: add helper for setting dma max seg size 2016-06-03 11:12:50 +02:00
videobuf2-dma-sg.c [media] media: vb2 dma-sg: Fully cache synchronise buffers in prepare and finish 2015-10-20 14:36:24 -02:00
videobuf2-dvb.c [media] add media controller support to videobuf2-dvb 2016-02-10 07:23:41 -02:00
videobuf2-memops.c [media] vb2-memops: Fix over allocation of frame vectors 2016-04-25 10:22:55 -03:00
videobuf2-v4l2.c [media] videobuf2-v4l2: Verify planes array in buffer dequeueing 2016-06-16 07:35:02 -03:00
videobuf2-vmalloc.c [media] media: videobuf2: Replace videobuf2-core with videobuf2-v4l2 2015-10-01 08:48:18 -03:00