From 0bb89252e60b85dcc38c72f323f2e2184f710a86 Mon Sep 17 00:00:00 2001 From: Janghyuck Kim Date: Thu, 12 Apr 2018 15:18:12 +0900 Subject: [PATCH] [COMMON] media: v4l2-core: fix compat ioctl Copying reserved2 field was missed, and signedness of reserved2 field was chagned. This patch corrected these bugs. Change-Id: Ia04ead949d34c42392efab2200fc1ca78a0d64b8 Signed-off-by: Janghyuck Kim --- drivers/media/v4l2-core/v4l2-compat-ioctl32.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/v4l2-core/v4l2-compat-ioctl32.c b/drivers/media/v4l2-core/v4l2-compat-ioctl32.c index 8da921c6dbd7..371612be2787 100644 --- a/drivers/media/v4l2-core/v4l2-compat-ioctl32.c +++ b/drivers/media/v4l2-core/v4l2-compat-ioctl32.c @@ -386,7 +386,7 @@ struct v4l2_buffer32 { __s32 fd; } m; __u32 length; - __s32 reserved2; + __u32 reserved2; union { __u32 fence_fd; __u32 reserved; @@ -610,7 +610,7 @@ static int put_v4l2_buffer32(struct v4l2_buffer __user *kp, copy_in_user(&up->timecode, &kp->timecode, sizeof(kp->timecode)) || assign_in_user(&up->sequence, &kp->sequence) || assign_in_user(&up->fence_fd, &kp->fence_fd) || - assign_in_user(&up->reserved, &kp->reserved) || + assign_in_user(&up->reserved2, &kp->reserved2) || get_user(length, &kp->length) || put_user(length, &up->length)) return -EFAULT; -- 2.20.1