From: kbuild test robot <lkp@intel.com>
To: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Cc: kbuild-all@01.org,
Mauro Carvalho Chehab <mchehab@s-opensource.com>,
Linux Media Mailing List <linux-media@vger.kernel.org>,
Mauro Carvalho Chehab <mchehab@infradead.org>,
Hans Verkuil <hansverk@cisco.com>,
Sakari Ailus <sakari.ailus@linux.intel.com>,
Daniel Mentz <danielmentz@google.com>,
Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Subject: Re: [PATCH] media: v4l2-compat-ioctl32: fix several __user annotations
Date: Sat, 14 Apr 2018 00:47:56 +0800 [thread overview]
Message-ID: <201804140054.dckpcFnp%fengguang.wu@intel.com> (raw)
In-Reply-To: <fba6bec696dfd6582f952c50ca5298b90b6b9c88.1523538149.git.mchehab@s-opensource.com>
[-- Attachment #1: Type: text/plain, Size: 4595 bytes --]
Hi Mauro,
I love your patch! Yet something to improve:
[auto build test ERROR on linuxtv-media/master]
[also build test ERROR on v4.16 next-20180413]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Mauro-Carvalho-Chehab/media-v4l2-compat-ioctl32-fix-several-__user-annotations/20180414-001705
base: git://linuxtv.org/media_tree.git master
config: x86_64-randconfig-x006-201814 (attached as .config)
compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64
All error/warnings (new ones prefixed by >>):
In file included from include/linux/uaccess.h:14:0,
from include/linux/compat.h:20,
from drivers/media/v4l2-core/v4l2-compat-ioctl32.c:16:
drivers/media/v4l2-core/v4l2-compat-ioctl32.c: In function 'put_v4l2_buffer32':
>> arch/x86/include/asm/uaccess.h:181:6: error: void value not ignored as it ought to be
(x) = (__force __typeof__(*(ptr))) __val_gu; \
^
>> drivers/media/v4l2-core/v4l2-compat-ioctl32.c:619:7: note: in expansion of macro 'get_user'
if (get_user(uplane, (__force void __user *)&kp->m.planes))
^~~~~~~~
--
In file included from include/linux/uaccess.h:14:0,
from include/linux/compat.h:20,
from drivers/media//v4l2-core/v4l2-compat-ioctl32.c:16:
drivers/media//v4l2-core/v4l2-compat-ioctl32.c: In function 'put_v4l2_buffer32':
>> arch/x86/include/asm/uaccess.h:181:6: error: void value not ignored as it ought to be
(x) = (__force __typeof__(*(ptr))) __val_gu; \
^
drivers/media//v4l2-core/v4l2-compat-ioctl32.c:619:7: note: in expansion of macro 'get_user'
if (get_user(uplane, (__force void __user *)&kp->m.planes))
^~~~~~~~
vim +/get_user +619 drivers/media/v4l2-core/v4l2-compat-ioctl32.c
580
581 static int put_v4l2_buffer32(struct v4l2_buffer __user *kp,
582 struct v4l2_buffer32 __user *up)
583 {
584 u32 type;
585 u32 length;
586 enum v4l2_memory memory;
587 struct v4l2_plane32 __user *uplane32;
588 struct v4l2_plane *uplane;
589 compat_caddr_t p;
590 int ret;
591
592 if (!access_ok(VERIFY_WRITE, up, sizeof(*up)) ||
593 assign_in_user(&up->index, &kp->index) ||
594 get_user(type, &kp->type) ||
595 put_user(type, &up->type) ||
596 assign_in_user(&up->flags, &kp->flags) ||
597 get_user(memory, &kp->memory) ||
598 put_user(memory, &up->memory))
599 return -EFAULT;
600
601 if (assign_in_user(&up->bytesused, &kp->bytesused) ||
602 assign_in_user(&up->field, &kp->field) ||
603 assign_in_user(&up->timestamp.tv_sec, &kp->timestamp.tv_sec) ||
604 assign_in_user(&up->timestamp.tv_usec, &kp->timestamp.tv_usec) ||
605 copy_in_user(&up->timecode, &kp->timecode, sizeof(kp->timecode)) ||
606 assign_in_user(&up->sequence, &kp->sequence) ||
607 assign_in_user(&up->reserved2, &kp->reserved2) ||
608 assign_in_user(&up->reserved, &kp->reserved) ||
609 get_user(length, &kp->length) ||
610 put_user(length, &up->length))
611 return -EFAULT;
612
613 if (V4L2_TYPE_IS_MULTIPLANAR(type)) {
614 u32 num_planes = length;
615
616 if (num_planes == 0)
617 return 0;
618
> 619 if (get_user(uplane, (__force void __user *)&kp->m.planes))
620 return -EFAULT;
621 if (get_user(p, &up->m.planes))
622 return -EFAULT;
623 uplane32 = compat_ptr(p);
624
625 while (num_planes--) {
626 ret = put_v4l2_plane32((void __user *)uplane,
627 uplane32, memory);
628 if (ret)
629 return ret;
630 ++uplane;
631 ++uplane32;
632 }
633 } else {
634 switch (memory) {
635 case V4L2_MEMORY_MMAP:
636 case V4L2_MEMORY_OVERLAY:
637 if (assign_in_user(&up->m.offset, &kp->m.offset))
638 return -EFAULT;
639 break;
640 case V4L2_MEMORY_USERPTR:
641 if (assign_in_user(&up->m.userptr, &kp->m.userptr))
642 return -EFAULT;
643 break;
644 case V4L2_MEMORY_DMABUF:
645 if (assign_in_user(&up->m.fd, &kp->m.fd))
646 return -EFAULT;
647 break;
648 }
649 }
650
651 return 0;
652 }
653
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 28890 bytes --]
next prev parent reply other threads:[~2018-04-13 16:48 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-12 13:02 [PATCH] media: v4l2-compat-ioctl32: fix several __user annotations Mauro Carvalho Chehab
2018-04-12 13:55 ` Mauro Carvalho Chehab
2018-04-13 16:47 ` kbuild test robot [this message]
2018-04-13 17:29 ` kbuild test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201804140054.dckpcFnp%fengguang.wu@intel.com \
--to=lkp@intel.com \
--cc=danielmentz@google.com \
--cc=hansverk@cisco.com \
--cc=kbuild-all@01.org \
--cc=laurent.pinchart+renesas@ideasonboard.com \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@infradead.org \
--cc=mchehab@s-opensource.com \
--cc=sakari.ailus@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.