linux-stable/drivers/media
Guennadi Liakhovetski 97d9d23dda [media] V4L2: fix VIDIOC_CREATE_BUFS in 64- / 32-bit compatibility mode
If a struct contains 64-bit fields, it is aligned on 64-bit boundaries
within containing structs in 64-bit compilations. This is the case with
struct v4l2_window, which contains pointers and is embedded into struct
v4l2_format, and that one is embedded into struct v4l2_create_buffers.
Unlike some other structs, used as a part of the kernel ABI as ioctl()
arguments, that are packed, these structs aren't packed. This isn't a
problem per se, but the ioctl-compat code for VIDIOC_CREATE_BUFS contains
a bug, that triggers in such 64-bit builds. That code wrongly assumes,
that in struct v4l2_create_buffers, struct v4l2_format immediately follows
the __u32 memory field, which in fact isn't the case. This bug wasn't
visible until now, because until recently hardly any applications used
this ioctl() and mostly embedded 32-bit only drivers implemented it. This
is changing now with addition of this ioctl() to some USB drivers, e.g.
UVC. This patch fixes the bug by copying parts of struct
v4l2_create_buffers separately.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Cc: stable@vger.kernel.org
2014-05-13 20:03:31 -03:00
..
common [media] rc: abstract access to allowed/enabled protocols 2014-03-11 13:24:39 -03:00
dvb-core [media] dvb_frontend: Fix possible read out of bounds 2014-03-12 10:21:09 -03:00
dvb-frontends [media] lgdt3305: include sleep functionality in lgdt3304_ops 2014-04-07 09:40:24 -03:00
firewire firewire: introduce fw_driver.probe and .remove methods 2013-06-09 18:15:00 +02:00
i2c [media] V4L2: ov7670: fix a wrong index, potentially Oopsing the kernel from user-space 2014-05-13 20:03:02 -03:00
mmc
parport [media] vb2: call buf_finish from __queue_cancel 2014-03-11 06:56:39 -03:00
pci Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media 2014-04-04 09:50:07 -07:00
platform [media] media: davinci: vpfe: make sure all the buffers unmapped and released 2014-04-15 09:54:38 -03:00
radio [media] si4713: fix Kconfig dependencies 2014-03-28 18:06:55 -03:00
rc [media] rc-core: remove generic scancode filter 2014-04-06 11:30:29 -03:00
tuners [media] fc2580: fix tuning failure on 32-bit arch 2014-04-16 18:13:11 -03:00
usb [media] Prefer gspca_sonixb over sn9c102 for all devices 2014-04-15 09:59:31 -03:00
v4l2-core [media] V4L2: fix VIDIOC_CREATE_BUFS in 64- / 32-bit compatibility mode 2014-05-13 20:03:31 -03:00
Kconfig [media] subdev autoselect only works if I2C and I2C_MUX is selected 2013-12-21 06:03:06 -02:00
Makefile
media-device.c [media] media-device: fix infoleak in ioctl media_enum_entities() 2014-05-01 05:53:28 -07:00
media-devnode.c
media-entity.c [media] media: Check for active links on pads with MEDIA_PAD_FL_MUST_CONNECT flag 2013-12-04 15:03:45 -02:00