media: v4l2-compat-ioctl32.c: fix ctrl_is_pointer 83/175683/1
authorHans Verkuil <hans.verkuil@cisco.com>
Wed, 28 Mar 2018 18:12:27 +0000 (15:12 -0300)
committerSeung-Woo Kim <sw0312.kim@samsung.com>
Wed, 11 Apr 2018 11:56:49 +0000 (20:56 +0900)
commit880cba7a82add50dd4cc03099d965864ae64543a
treefbac21a3133a0686aee610880b0a2cf04cdf148e
parente19485941f43d7f0d03bccf97c0ecb7b4822f19e
media: v4l2-compat-ioctl32.c: fix ctrl_is_pointer

commit b8c601e8af2d08f733d74defa8465303391bb930 upstream.

ctrl_is_pointer just hardcoded two known string controls, but that
caused problems when using e.g. custom controls that use a pointer
for the payload.

Reimplement this function: it now finds the v4l2_ctrl (if the driver
uses the control framework) or it calls vidioc_query_ext_ctrl (if the
driver implements that directly).

In both cases it can now check if the control is a pointer control
or not.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[sw0312.kim: cherry-pick from linux-3.18.y to apply CVE patch]
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Change-Id: Iead5cedaa99187b870ff120fb737640a37ab09c1
drivers/media/v4l2-core/v4l2-compat-ioctl32.c