linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RESEND PATCH v2] media: v4l2-compat-ioctl32: fix missing length copy in put_v4l2_buffer32
@ 2016-01-15  3:28 Tiffany Lin
  2016-01-15  8:33 ` Hans Verkuil
  0 siblings, 1 reply; 2+ messages in thread
From: Tiffany Lin @ 2016-01-15  3:28 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Hans Verkuil
  Cc: Eddie Huang, Yingjoe Chen, linux-media, linux-mediatek, Tiffany Lin

In v4l2-compliance utility, test QUERYBUF required correct length
value to go through each planar to check planar's length in
multi-planar buffer type

Signed-off-by: Tiffany Lin <tiffany.lin@mediatek.com>
---
Remove "Change-Id: I98faddc5711c24f17beda52e6d18c657add251ac"
---

 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..6c01920 100644
--- a/drivers/media/v4l2-core/v4l2-compat-ioctl32.c
+++ b/drivers/media/v4l2-core/v4l2-compat-ioctl32.c
@@ -516,6 +516,9 @@ static int put_v4l2_buffer32(struct v4l2_buffer *kp, struct v4l2_buffer32 __user
 		put_user(kp->reserved, &up->reserved))
 			return -EFAULT;
 
+	if (put_user(kp->length, &up->length))
+		return -EFAULT;
+
 	if (V4L2_TYPE_IS_MULTIPLANAR(kp->type)) {
 		num_planes = kp->length;
 		if (num_planes == 0)
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [RESEND PATCH v2] media: v4l2-compat-ioctl32: fix missing length copy in put_v4l2_buffer32
  2016-01-15  3:28 [RESEND PATCH v2] media: v4l2-compat-ioctl32: fix missing length copy in put_v4l2_buffer32 Tiffany Lin
@ 2016-01-15  8:33 ` Hans Verkuil
  0 siblings, 0 replies; 2+ messages in thread
From: Hans Verkuil @ 2016-01-15  8:33 UTC (permalink / raw)
  To: Tiffany Lin, Mauro Carvalho Chehab
  Cc: Eddie Huang, Yingjoe Chen, linux-media, linux-mediatek

On 01/15/2016 04:28 AM, Tiffany Lin wrote:
> In v4l2-compliance utility, test QUERYBUF required correct length
> value to go through each planar to check planar's length in
> multi-planar buffer type
> 
> Signed-off-by: Tiffany Lin <tiffany.lin@mediatek.com>
> ---
> Remove "Change-Id: I98faddc5711c24f17beda52e6d18c657add251ac"
> ---
> 
>  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..6c01920 100644
> --- a/drivers/media/v4l2-core/v4l2-compat-ioctl32.c
> +++ b/drivers/media/v4l2-core/v4l2-compat-ioctl32.c
> @@ -516,6 +516,9 @@ static int put_v4l2_buffer32(struct v4l2_buffer *kp, struct v4l2_buffer32 __user
>  		put_user(kp->reserved, &up->reserved))
>  			return -EFAULT;
>  
> +	if (put_user(kp->length, &up->length))
> +		return -EFAULT;
> +

This should also be done for get_v4l2_buffer32, and the other places where
length is used in put/get_user() can now be removed.

Regards,

	Hans

>  	if (V4L2_TYPE_IS_MULTIPLANAR(kp->type)) {
>  		num_planes = kp->length;
>  		if (num_planes == 0)
> 


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-01-15  8:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-15  3:28 [RESEND PATCH v2] media: v4l2-compat-ioctl32: fix missing length copy in put_v4l2_buffer32 Tiffany Lin
2016-01-15  8:33 ` Hans Verkuil

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).