diff options
author | Guennadi Liakhovetski <g.liakhovetski@gmx.de> | 2014-04-26 12:51:31 -0300 |
---|---|---|
committer | Jiri Slaby <jslaby@suse.cz> | 2014-06-09 15:54:00 +0200 |
commit | 75ffd3e398d343c4f015791df100e6d5b9814982 (patch) | |
tree | 6965f479ac22871dcc508a5fb20a579e7180c493 /kernel/futex.c | |
parent | b331e3acf154ec3e70f80a77cd4396100b506449 (diff) |
media: V4L2: fix VIDIOC_CREATE_BUFS in 64- / 32-bit compatibility mode
commit 97d9d23dda6f37d90aefeec4ed619d52df525382 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: Jiri Slaby <jslaby@suse.cz>
Diffstat (limited to 'kernel/futex.c')
0 files changed, 0 insertions, 0 deletions