linux-uconsole/drivers/media
Guennadi Liakhovetski 3c3fa08f4c media: V4L2: fix VIDIOC_CREATE_BUFS in 64- / 32-bit compatibility mode
commit 97d9d23dda upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-07 13:25:40 -07:00
..
common media: siano: fix divide error on 0 counters 2013-09-26 17:18:27 -07:00
dvb-core media: dmxdev: remove dvb_ringbuffer_flush() on writer side 2013-07-28 16:30:21 -07:00
dvb-frontends media: m88rs2000: add caps FE_CAN_INVERSION_AUTO 2014-05-06 07:55:31 -07:00
firewire [media] demux.h: Remove duplicated enum 2013-04-08 06:53:15 -03:00
i2c media: V4L2: ov7670: fix a wrong index, potentially Oopsing the kernel from user-space 2014-06-07 13:25:40 -07:00
mmc [media] siano: get rid of CammelCase from smscoreapi.h 2013-03-21 10:03:16 -03:00
parport [media] v4l2: pass std by value to the write-only s_std ioctl 2013-03-24 06:47:00 -03:00
pci media: saa7134: fix WARN_ON during resume 2014-05-06 07:55:31 -07:00
platform omap3isp: Defer probe when the IOMMU is not available 2014-06-07 13:25:33 -07:00
radio Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media 2013-06-18 06:25:08 -10:00
rc Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2013-05-01 17:51:54 -07:00
tuners media: fc2580: fix tuning failure on 32-bit arch 2014-06-07 13:25:40 -07:00
usb media: media: gspca: sn9c20x: add ID for Genius Look 1320 V2 2014-05-06 07:55:31 -07:00
v4l2-core media: V4L2: fix VIDIOC_CREATE_BUFS in 64- / 32-bit compatibility mode 2014-06-07 13:25:40 -07:00
Kconfig [media] Fix build when drivers are builtin and frontend modules 2013-06-20 10:35:53 -03:00
Makefile [media] move i2c files into drivers/media/i2c 2012-09-06 18:42:54 -03:00
media-device.c media: media-device: fix infoleak in ioctl media_enum_entities() 2014-06-07 13:25:35 -07:00
media-devnode.c [media] media: Add 64--32 bit compat ioctl handler 2013-03-18 20:44:36 -03:00
media-entity.c