[PATCH] media: v4l2-compat-ioctl32: fix missing length copy in put_v4l2_buffer32
Tiffany Lin
tiffany.lin at mediatek.com
Wed Jan 13 23:37:25 PST 2016
In v4l2-compliance utility, test QUERYBUF required correct length
value to go through each planar to check planar's length in multi-planar
Signed-off-by: Tiffany Lin <tiffany.lin at mediatek.com>
---
drivers/media/v4l2-core/v4l2-compat-ioctl32.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/media/v4l2-core/v4l2-compat-ioctl32.c b/drivers/media/v4l2-core/v4l2-compat-ioctl32.c
index 327e83a..5ba932a 100644
--- a/drivers/media/v4l2-core/v4l2-compat-ioctl32.c
+++ b/drivers/media/v4l2-core/v4l2-compat-ioctl32.c
@@ -521,6 +521,9 @@ static int put_v4l2_buffer32(struct v4l2_buffer *kp, struct v4l2_buffer32 __user
if (num_planes == 0)
return 0;
+ if (put_user(kp->length, &up->length))
+ return -EFAULT;
+
uplane = (__force struct v4l2_plane __user *)kp->m.planes;
if (get_user(p, &up->m.planes))
return -EFAULT;
--
1.7.9.5
More information about the Linux-mediatek
mailing list