Home Home > GIT Browse > SLE15
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2019-06-24 12:03:41 +0200
committerTakashi Iwai <tiwai@suse.de>2019-06-24 12:03:43 +0200
commit05cb5ff0b33aa6584747cb6119c750546790bd7d (patch)
treee04e7fbc21e03a745e7ca45e83d7f1e34eeed502
parent068c6e9cc9fb0b3faee8da7780be1f1a288653fc (diff)
media: v4l2-ioctl: clear fields in s_parm (bsc#1051510).
-rw-r--r--patches.drivers/media-v4l2-ioctl-clear-fields-in-s_parm.patch55
-rw-r--r--series.conf1
2 files changed, 56 insertions, 0 deletions
diff --git a/patches.drivers/media-v4l2-ioctl-clear-fields-in-s_parm.patch b/patches.drivers/media-v4l2-ioctl-clear-fields-in-s_parm.patch
new file mode 100644
index 0000000000..4dfc1a26db
--- /dev/null
+++ b/patches.drivers/media-v4l2-ioctl-clear-fields-in-s_parm.patch
@@ -0,0 +1,55 @@
+From 8a7c5594c02022ca5fa7fb603e11b3e1feb76ed5 Mon Sep 17 00:00:00 2001
+From: Hans Verkuil <hans.verkuil@cisco.com>
+Date: Sat, 12 May 2018 10:44:02 -0400
+Subject: [PATCH] media: v4l2-ioctl: clear fields in s_parm
+Git-commit: 8a7c5594c02022ca5fa7fb603e11b3e1feb76ed5
+Patch-mainline: v4.18-rc1
+References: bsc#1051510
+
+Zero the reserved capture/output array.
+
+Zero the extendedmode (it is never used in drivers).
+
+Clear all flags in capture/outputmode except for V4L2_MODE_HIGHQUALITY,
+as that is the only valid flag.
+
+Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
+Reviewed-by: Hans de Goede <hdegoede@redhat.com>
+Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
+Acked-by: Takashi Iwai <tiwai@suse.de>
+
+---
+ drivers/media/v4l2-core/v4l2-ioctl.c | 17 ++++++++++++++++-
+ 1 file changed, 16 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c
+index a40dbec271f1..212aac1d22c1 100644
+--- a/drivers/media/v4l2-core/v4l2-ioctl.c
++++ b/drivers/media/v4l2-core/v4l2-ioctl.c
+@@ -1952,7 +1952,22 @@ static int v4l_s_parm(const struct v4l2_ioctl_ops *ops,
+ struct v4l2_streamparm *p = arg;
+ int ret = check_fmt(file, p->type);
+
+- return ret ? ret : ops->vidioc_s_parm(file, fh, p);
++ if (ret)
++ return ret;
++
++ /* Note: extendedmode is never used in drivers */
++ if (V4L2_TYPE_IS_OUTPUT(p->type)) {
++ memset(p->parm.output.reserved, 0,
++ sizeof(p->parm.output.reserved));
++ p->parm.output.extendedmode = 0;
++ p->parm.output.outputmode &= V4L2_MODE_HIGHQUALITY;
++ } else {
++ memset(p->parm.capture.reserved, 0,
++ sizeof(p->parm.capture.reserved));
++ p->parm.capture.extendedmode = 0;
++ p->parm.capture.capturemode &= V4L2_MODE_HIGHQUALITY;
++ }
++ return ops->vidioc_s_parm(file, fh, p);
+ }
+
+ static int v4l_queryctrl(const struct v4l2_ioctl_ops *ops,
+--
+2.16.4
+
diff --git a/series.conf b/series.conf
index fb61c0acb0..939fb1eea1 100644
--- a/series.conf
+++ b/series.conf
@@ -17075,6 +17075,7 @@
patches.drivers/media-rcar_jpu-Add-missing-clk_disable_unprepare-on-
patches.suse/0001-media-smiapp-fix-timeout-checking-in-smiapp_read_nvm.patch
patches.drivers/media-videobuf2-core-don-t-call-memop-finish-when-qu
+ patches.drivers/media-v4l2-ioctl-clear-fields-in-s_parm.patch
patches.drivers/media-vivid-potential-integer-overflow-in-vidioc_g_e
patches.drivers/media-tw686x-Fix-incorrect-vb2_mem_ops-GFP-flags
patches.drivers/media-uvcvideo-Support-realtek-s-UVC-1.5-device