From: Janghyuck Kim Date: Thu, 12 Apr 2018 06:18:12 +0000 (+0900) Subject: [COMMON] media: v4l2-core: fix compat ioctl X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=0bb89252e60b85dcc38c72f323f2e2184f710a86;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [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 --- 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;