All of lore.kernel.org
 help / color / mirror / Atom feed
* [git:media_tree/master] [media] media: v4l2-compat-ioctl32: fix missing reserved field copy in put_v4l2_create32
@ 2016-04-13 20:08 Mauro Carvalho Chehab
  0 siblings, 0 replies; only message in thread
From: Mauro Carvalho Chehab @ 2016-04-13 20:08 UTC (permalink / raw)
  To: linuxtv-commits; +Cc: Hans Verkuil, Tiffany Lin, stable

This is an automatic generated email to let you know that the following patch were queued:

Subject: [media] media: v4l2-compat-ioctl32: fix missing reserved field copy in put_v4l2_create32
Author:  Tiffany Lin <tiffany.lin@mediatek.com>
Date:    Mon Mar 14 08:16:14 2016 -0300

In v4l2-compliance utility, test VIDIOC_CREATE_BUFS will check whether reserved
filed of v4l2_create_buffers filled with zero
Reserved field is filled with zero in v4l_create_bufs.
This patch copy reserved field of v4l2_create_buffer from kernel space to user
space

Signed-off-by: Tiffany Lin <tiffany.lin@mediatek.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Cc: <stable@vger.kernel.org>      # for v3.19 and up
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>

 drivers/media/v4l2-core/v4l2-compat-ioctl32.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

---

diff --git a/drivers/media/v4l2-core/v4l2-compat-ioctl32.c b/drivers/media/v4l2-core/v4l2-compat-ioctl32.c
index 019644ff627d..bacecbd68a6d 100644
--- a/drivers/media/v4l2-core/v4l2-compat-ioctl32.c
+++ b/drivers/media/v4l2-core/v4l2-compat-ioctl32.c
@@ -280,7 +280,8 @@ static int put_v4l2_format32(struct v4l2_format *kp, struct v4l2_format32 __user
 static int put_v4l2_create32(struct v4l2_create_buffers *kp, struct v4l2_create_buffers32 __user *up)
 {
 	if (!access_ok(VERIFY_WRITE, up, sizeof(struct v4l2_create_buffers32)) ||
-	    copy_to_user(up, kp, offsetof(struct v4l2_create_buffers32, format)))
+	    copy_to_user(up, kp, offsetof(struct v4l2_create_buffers32, format)) ||
+	    copy_to_user(up->reserved, kp->reserved, sizeof(kp->reserved)))
 		return -EFAULT;
 	return __put_v4l2_format32(&kp->format, &up->format);
 }

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2016-04-13 20:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-13 20:08 [git:media_tree/master] [media] media: v4l2-compat-ioctl32: fix missing reserved field copy in put_v4l2_create32 Mauro Carvalho Chehab

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.