V4L2: fix VIDIOC_CREATE_BUFS 32-bit compatibility mode data copy-back
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>
Fri, 30 May 2014 23:26:38 +0000 (20:26 -0300)
committerBen Hutchings <ben@decadent.org.uk>
Sat, 3 Mar 2018 15:51:04 +0000 (15:51 +0000)
commitfd15ac92bcc6276caccfe2e745b593b9a1d62dd9
treebd10a152ec0790b70e957904e330b6e2b8c0a630
parent52604531f71632b2cb474a0af411a3140908321c
V4L2: fix VIDIOC_CREATE_BUFS 32-bit compatibility mode data copy-back

commit 6ed9b28504326f8cf542e6b68245b2f7ce009216 upstream.

Similar to an earlier patch, fixing reading user-space data for the
VIDIOC_CREATE_BUFS ioctl() in 32-bit compatibility mode, this patch fixes
writing back of the possibly modified struct to the user. However, unlike
the former bug, this one is much less harmful, because it only results in
the kernel failing to write the .type field back to the user, but in fact
this is likely unneeded, because the kernel will hardly want to change
that field. Therefore this bug is more of a theoretical nature.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
[bwh: Backported to 3.2: adjust filename]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/media/video/v4l2-compat-ioctl32.c