tree:
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
linux-4.14.y
head: e1f7d50ae3a3ec342e87a9b1ce6787bfb8b3c08b
commit: 9bee4f9f4460db86c47fe01f9671af6a8951efda [9050/9999] powerpc: Fix duplicate const
clang warning in user access code
config: powerpc-randconfig-s031-20201016 (attached as .config)
compiler: powerpc64-linux-gcc (GCC) 7.5.0
reproduce:
wget
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O
~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.3-rc1-2-g368fd9ce-dirty
#
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gi...
git remote add linux-stable-rc
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
git fetch --no-tags linux-stable-rc linux-4.14.y
git checkout 9bee4f9f4460db86c47fe01f9671af6a8951efda
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-7.5.0 make.cross C=1
CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=powerpc
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
"sparse warnings: (new ones prefixed by >>)"
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:447:21: sparse: sparse: incorrect type in
argument 1 (different address spaces) @@ expected void [noderef] <asn:1> *uptr
@@ got void * @@
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:447:21: sparse: expected void
[noderef] <asn:1> *uptr
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:447:21: sparse: got void *
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:447:21: sparse: sparse: incorrect type in
argument 1 (different address spaces) @@ expected void [noderef] <asn:1> *uptr
@@ got void * @@
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:447:21: sparse: expected void
[noderef] <asn:1> *uptr
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:447:21: sparse: got void *
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:447:21: sparse: sparse: incorrect type in
argument 1 (different address spaces) @@ expected void [noderef] <asn:1> *uptr
@@ got void * @@
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:447:21: sparse: expected void
[noderef] <asn:1> *uptr
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:447:21: sparse: got void *
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:447:21: sparse: sparse: incorrect type in
argument 1 (different address spaces) @@ expected void [noderef] <asn:1> *uptr
@@ got void * @@
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:447:21: sparse: expected void
[noderef] <asn:1> *uptr
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:447:21: sparse: got void *
> drivers/media/v4l2-core/v4l2-compat-ioctl32.c:621:21: sparse:
sparse: incorrect type in initializer (different address spaces) @@ expected struct
v4l2_plane [noderef] <asn:1> *[noderef] <asn:1> *__gu_addr @@ got struct
v4l2_plane [noderef] <asn:1> ** @@
> drivers/media/v4l2-core/v4l2-compat-ioctl32.c:621:21: sparse: expected struct
v4l2_plane [noderef] <asn:1> *[noderef] <asn:1> *__gu_addr
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:621:21: sparse: got struct v4l2_plane
[noderef] <asn:1> **
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:693:13: sparse: sparse: incorrect type in
argument 1 (different address spaces) @@ expected void [noderef] <asn:1> *uptr
@@ got void *[assigned] base @@
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:693:13: sparse: expected void
[noderef] <asn:1> *uptr
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:693:13: sparse: got void *[assigned]
base
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:693:13: sparse: sparse: incorrect type in
argument 1 (different address spaces) @@ expected void [noderef] <asn:1> *uptr
@@ got void *[assigned] base @@
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:693:13: sparse: expected void
[noderef] <asn:1> *uptr
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:693:13: sparse: got void *[assigned]
base
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:693:13: sparse: sparse: incorrect type in
argument 1 (different address spaces) @@ expected void [noderef] <asn:1> *uptr
@@ got void *[assigned] base @@
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:693:13: sparse: expected void
[noderef] <asn:1> *uptr
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:693:13: sparse: got void *[assigned]
base
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:693:13: sparse: sparse: incorrect type in
argument 1 (different address spaces) @@ expected void [noderef] <asn:1> *uptr
@@ got void *[assigned] base @@
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:693:13: sparse: expected void
[noderef] <asn:1> *uptr
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:693:13: sparse: got void *[assigned]
base
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:871:13: sparse: sparse: incorrect type in
assignment (different address spaces) @@ expected struct v4l2_ext_control [noderef]
<asn:1> *kcontrols @@ got struct v4l2_ext_control * @@
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:871:13: sparse: expected struct
v4l2_ext_control [noderef] <asn:1> *kcontrols
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:871:13: sparse: got struct
v4l2_ext_control *
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:957:13: sparse: sparse: cast removes
address space '<asn:1>' of expression
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:957:13: sparse: sparse: cast removes
address space '<asn:1>' of expression
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:957:13: sparse: sparse: cast removes
address space '<asn:1>' of expression
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:957:13: sparse: sparse: cast removes
address space '<asn:1>' of expression
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:973:13: sparse: sparse: incorrect type in
argument 1 (different address spaces) @@ expected void [noderef] <asn:1> *uptr
@@ got void *[assigned] edid @@
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:973:13: sparse: expected void
[noderef] <asn:1> *uptr
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:973:13: sparse: got void *[assigned]
edid
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:973:13: sparse: sparse: incorrect type in
argument 1 (different address spaces) @@ expected void [noderef] <asn:1> *uptr
@@ got void *[assigned] edid @@
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:973:13: sparse: expected void
[noderef] <asn:1> *uptr
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:973:13: sparse: got void *[assigned]
edid
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:973:13: sparse: sparse: incorrect type in
argument 1 (different address spaces) @@ expected void [noderef] <asn:1> *uptr
@@ got void *[assigned] edid @@
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:973:13: sparse: expected void
[noderef] <asn:1> *uptr
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:973:13: sparse: got void *[assigned]
edid
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:973:13: sparse: sparse: incorrect type in
argument 1 (different address spaces) @@ expected void [noderef] <asn:1> *uptr
@@ got void *[assigned] edid @@
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:973:13: sparse: expected void
[noderef] <asn:1> *uptr
drivers/media/v4l2-core/v4l2-compat-ioctl32.c:973:13: sparse: got void *[assigned]
edid
vim +621 drivers/media/v4l2-core/v4l2-compat-ioctl32.c
cf664a6458b254 drivers/media/video/compat_ioctl32.c Philippe De Muyter 2006-01-09
582
ad01b40bb9be09 drivers/media/v4l2-core/v4l2-compat-ioctl32.c Daniel Mentz 2018-02-14
583 static int put_v4l2_buffer32(struct v4l2_buffer __user *kp,
ad01b40bb9be09 drivers/media/v4l2-core/v4l2-compat-ioctl32.c Daniel Mentz 2018-02-14
584 struct v4l2_buffer32 __user *up)
cf664a6458b254 drivers/media/video/compat_ioctl32.c Philippe De Muyter 2006-01-09
585 {
ad01b40bb9be09 drivers/media/v4l2-core/v4l2-compat-ioctl32.c Daniel Mentz 2018-02-14
586 u32 type;
ad01b40bb9be09 drivers/media/v4l2-core/v4l2-compat-ioctl32.c Daniel Mentz 2018-02-14
587 u32 length;
ad01b40bb9be09 drivers/media/v4l2-core/v4l2-compat-ioctl32.c Daniel Mentz 2018-02-14
588 enum v4l2_memory memory;
52a3082fea41ff drivers/media/video/v4l2-compat-ioctl32.c Pawel Osciak 2010-07-29
589 struct v4l2_plane32 __user *uplane32;
52a3082fea41ff drivers/media/video/v4l2-compat-ioctl32.c Pawel Osciak 2010-07-29
590 struct v4l2_plane __user *uplane;
52a3082fea41ff drivers/media/video/v4l2-compat-ioctl32.c Pawel Osciak 2010-07-29
591 compat_caddr_t p;
52a3082fea41ff drivers/media/video/v4l2-compat-ioctl32.c Pawel Osciak 2010-07-29
592 int ret;
52a3082fea41ff drivers/media/video/v4l2-compat-ioctl32.c Pawel Osciak 2010-07-29
593
16c25072560fb3 drivers/media/v4l2-core/v4l2-compat-ioctl32.c Hans Verkuil 2018-02-14
594 if (!access_ok(VERIFY_WRITE, up, sizeof(*up)) ||
ad01b40bb9be09 drivers/media/v4l2-core/v4l2-compat-ioctl32.c Daniel Mentz 2018-02-14
595 assign_in_user(&up->index, &kp->index) ||
ad01b40bb9be09 drivers/media/v4l2-core/v4l2-compat-ioctl32.c Daniel Mentz 2018-02-14
596 get_user(type, &kp->type) ||
ad01b40bb9be09 drivers/media/v4l2-core/v4l2-compat-ioctl32.c Daniel Mentz 2018-02-14
597 put_user(type, &up->type) ||
ad01b40bb9be09 drivers/media/v4l2-core/v4l2-compat-ioctl32.c Daniel Mentz 2018-02-14
598 assign_in_user(&up->flags, &kp->flags) ||
ad01b40bb9be09 drivers/media/v4l2-core/v4l2-compat-ioctl32.c Daniel Mentz 2018-02-14
599 get_user(memory, &kp->memory) ||
ad01b40bb9be09 drivers/media/v4l2-core/v4l2-compat-ioctl32.c Daniel Mentz 2018-02-14
600 put_user(memory, &up->memory))
cf664a6458b254 drivers/media/video/compat_ioctl32.c Philippe De Muyter 2006-01-09
601 return -EFAULT;
52a3082fea41ff drivers/media/video/v4l2-compat-ioctl32.c Pawel Osciak 2010-07-29
602
ad01b40bb9be09 drivers/media/v4l2-core/v4l2-compat-ioctl32.c Daniel Mentz 2018-02-14
603 if (assign_in_user(&up->bytesused, &kp->bytesused) ||
ad01b40bb9be09 drivers/media/v4l2-core/v4l2-compat-ioctl32.c Daniel Mentz 2018-02-14
604 assign_in_user(&up->field, &kp->field) ||
ad01b40bb9be09 drivers/media/v4l2-core/v4l2-compat-ioctl32.c Daniel Mentz 2018-02-14
605 assign_in_user(&up->timestamp.tv_sec, &kp->timestamp.tv_sec) ||
ad01b40bb9be09 drivers/media/v4l2-core/v4l2-compat-ioctl32.c Daniel Mentz 2018-02-14
606 assign_in_user(&up->timestamp.tv_usec, &kp->timestamp.tv_usec)
||
ad01b40bb9be09 drivers/media/v4l2-core/v4l2-compat-ioctl32.c Daniel Mentz 2018-02-14
607 copy_in_user(&up->timecode, &kp->timecode,
sizeof(kp->timecode)) ||
ad01b40bb9be09 drivers/media/v4l2-core/v4l2-compat-ioctl32.c Daniel Mentz 2018-02-14
608 assign_in_user(&up->sequence, &kp->sequence) ||
ad01b40bb9be09 drivers/media/v4l2-core/v4l2-compat-ioctl32.c Daniel Mentz 2018-02-14
609 assign_in_user(&up->reserved2, &kp->reserved2) ||
ad01b40bb9be09 drivers/media/v4l2-core/v4l2-compat-ioctl32.c Daniel Mentz 2018-02-14
610 assign_in_user(&up->reserved, &kp->reserved) ||
ad01b40bb9be09 drivers/media/v4l2-core/v4l2-compat-ioctl32.c Daniel Mentz 2018-02-14
611 get_user(length, &kp->length) ||
ad01b40bb9be09 drivers/media/v4l2-core/v4l2-compat-ioctl32.c Daniel Mentz 2018-02-14
612 put_user(length, &up->length))
52a3082fea41ff drivers/media/video/v4l2-compat-ioctl32.c Pawel Osciak 2010-07-29
613 return -EFAULT;
52a3082fea41ff drivers/media/video/v4l2-compat-ioctl32.c Pawel Osciak 2010-07-29
614
ad01b40bb9be09 drivers/media/v4l2-core/v4l2-compat-ioctl32.c Daniel Mentz 2018-02-14
615 if (V4L2_TYPE_IS_MULTIPLANAR(type)) {
ad01b40bb9be09 drivers/media/v4l2-core/v4l2-compat-ioctl32.c Daniel Mentz 2018-02-14
616 u32 num_planes = length;
ad01b40bb9be09 drivers/media/v4l2-core/v4l2-compat-ioctl32.c Daniel Mentz 2018-02-14
617
52a3082fea41ff drivers/media/video/v4l2-compat-ioctl32.c Pawel Osciak 2010-07-29
618 if (num_planes == 0)
52a3082fea41ff drivers/media/video/v4l2-compat-ioctl32.c Pawel Osciak 2010-07-29
619 return 0;
52a3082fea41ff drivers/media/video/v4l2-compat-ioctl32.c Pawel Osciak 2010-07-29
620
ad01b40bb9be09 drivers/media/v4l2-core/v4l2-compat-ioctl32.c Daniel Mentz 2018-02-14
@621 if (get_user(uplane, ((__force struct v4l2_plane __user
**)&kp->m.planes)))
ad01b40bb9be09 drivers/media/v4l2-core/v4l2-compat-ioctl32.c Daniel Mentz 2018-02-14
622 return -EFAULT;
52a3082fea41ff drivers/media/video/v4l2-compat-ioctl32.c Pawel Osciak 2010-07-29
623 if (get_user(p, &up->m.planes))
52a3082fea41ff drivers/media/video/v4l2-compat-ioctl32.c Pawel Osciak 2010-07-29
624 return -EFAULT;
52a3082fea41ff drivers/media/video/v4l2-compat-ioctl32.c Pawel Osciak 2010-07-29
625 uplane32 = compat_ptr(p);
52a3082fea41ff drivers/media/video/v4l2-compat-ioctl32.c Pawel Osciak 2010-07-29
626
ad01b40bb9be09 drivers/media/v4l2-core/v4l2-compat-ioctl32.c Daniel Mentz 2018-02-14
627 while (num_planes--) {
ad01b40bb9be09 drivers/media/v4l2-core/v4l2-compat-ioctl32.c Daniel Mentz 2018-02-14
628 ret = put_v4l2_plane32(uplane, uplane32, memory);
52a3082fea41ff drivers/media/video/v4l2-compat-ioctl32.c Pawel Osciak 2010-07-29
629 if (ret)
52a3082fea41ff drivers/media/video/v4l2-compat-ioctl32.c Pawel Osciak 2010-07-29
630 return ret;
52a3082fea41ff drivers/media/video/v4l2-compat-ioctl32.c Pawel Osciak 2010-07-29
631 ++uplane;
52a3082fea41ff drivers/media/video/v4l2-compat-ioctl32.c Pawel Osciak 2010-07-29
632 ++uplane32;
52a3082fea41ff drivers/media/video/v4l2-compat-ioctl32.c Pawel Osciak 2010-07-29
633 }
52a3082fea41ff drivers/media/video/v4l2-compat-ioctl32.c Pawel Osciak 2010-07-29
634 } else {
ad01b40bb9be09 drivers/media/v4l2-core/v4l2-compat-ioctl32.c Daniel Mentz 2018-02-14
635 switch (memory) {
cf664a6458b254 drivers/media/video/compat_ioctl32.c Philippe De Muyter 2006-01-09
636 case V4L2_MEMORY_MMAP:
3df1197724661c drivers/media/v4l2-core/v4l2-compat-ioctl32.c Hans Verkuil 2018-02-14
637 case V4L2_MEMORY_OVERLAY:
ad01b40bb9be09 drivers/media/v4l2-core/v4l2-compat-ioctl32.c Daniel Mentz 2018-02-14
638 if (assign_in_user(&up->m.offset, &kp->m.offset))
a113bc787e9b0e drivers/media/video/compat_ioctl32.c Guy Martin 2006-01-11
639 return -EFAULT;
cf664a6458b254 drivers/media/video/compat_ioctl32.c Philippe De Muyter 2006-01-09
640 break;
cf664a6458b254 drivers/media/video/compat_ioctl32.c Philippe De Muyter 2006-01-09
641 case V4L2_MEMORY_USERPTR:
ad01b40bb9be09 drivers/media/v4l2-core/v4l2-compat-ioctl32.c Daniel Mentz 2018-02-14
642 if (assign_in_user(&up->m.userptr, &kp->m.userptr))
a113bc787e9b0e drivers/media/video/compat_ioctl32.c Guy Martin 2006-01-11
643 return -EFAULT;
cf664a6458b254 drivers/media/video/compat_ioctl32.c Philippe De Muyter 2006-01-09
644 break;
051c7788bcb92f drivers/media/v4l2-core/v4l2-compat-ioctl32.c Sumit Semwal 2012-06-14
645 case V4L2_MEMORY_DMABUF:
ad01b40bb9be09 drivers/media/v4l2-core/v4l2-compat-ioctl32.c Daniel Mentz 2018-02-14
646 if (assign_in_user(&up->m.fd, &kp->m.fd))
051c7788bcb92f drivers/media/v4l2-core/v4l2-compat-ioctl32.c Sumit Semwal 2012-06-14
647 return -EFAULT;
051c7788bcb92f drivers/media/v4l2-core/v4l2-compat-ioctl32.c Sumit Semwal 2012-06-14
648 break;
cf664a6458b254 drivers/media/video/compat_ioctl32.c Philippe De Muyter 2006-01-09
649 }
52a3082fea41ff drivers/media/video/v4l2-compat-ioctl32.c Pawel Osciak 2010-07-29
650 }
52a3082fea41ff drivers/media/video/v4l2-compat-ioctl32.c Pawel Osciak 2010-07-29
651
cf664a6458b254 drivers/media/video/compat_ioctl32.c Philippe De Muyter 2006-01-09
652 return 0;
cf664a6458b254 drivers/media/video/compat_ioctl32.c Philippe De Muyter 2006-01-09
653 }
cf664a6458b254 drivers/media/video/compat_ioctl32.c Philippe De Muyter 2006-01-09
654
:::::: The code at line 621 was first introduced by commit
:::::: ad01b40bb9be0987e883655205606c710a8785a5 media: v4l2-compat-ioctl32.c: refactor
compat ioctl32 logic
:::::: TO: Daniel Mentz <danielmentz(a)google.com>
:::::: CC: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org