tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: 83bdc7275e6206f560d247be856bceba3e1ed8f2 commit: 670d0a4b10704667765f7d18f7592993d02783aa sparse: use identifiers to define address spaces date: 6 weeks ago config: openrisc-randconfig-s031-20200730 (attached as .config) compiler: or1k-linux-gcc (GCC) 9.3.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.2-98-g4932334a-dirty git checkout 670d0a4b10704667765f7d18f7592993d02783aa # save the attached .config to linux build tree COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=openrisc
If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot <l...@intel.com> sparse warnings: (new ones prefixed by >>) >> security/apparmor/lsm.c:1101:21: sparse: sparse: incorrect type in >> initializer (different address spaces) @@ expected int *__pu_addr @@ >> got int [noderef] __user *optlen @@ security/apparmor/lsm.c:1101:21: sparse: expected int *__pu_addr >> security/apparmor/lsm.c:1101:21: sparse: got int [noderef] __user *optlen security/apparmor/lsm.c: note: in included file (through include/asm-generic/atomic.h, arch/openrisc/include/asm/atomic.h, include/linux/atomic.h, ...): arch/openrisc/include/asm/cmpxchg.h:69:29: sparse: sparse: shift too big (32) for type int arch/openrisc/include/asm/cmpxchg.h:69:29: sparse: sparse: shift too big (32) for type int arch/openrisc/include/asm/cmpxchg.h:69:29: sparse: sparse: shift too big (32) for type int arch/openrisc/include/asm/cmpxchg.h:69:29: sparse: sparse: shift too big (32) for type int arch/openrisc/include/asm/cmpxchg.h:69:29: sparse: sparse: shift too big (32) for type int arch/openrisc/include/asm/cmpxchg.h:69:29: sparse: sparse: shift too big (32) for type int arch/openrisc/include/asm/cmpxchg.h:69:29: sparse: sparse: shift too big (32) for type int arch/openrisc/include/asm/cmpxchg.h:69:29: sparse: sparse: shift too big (32) for type int arch/openrisc/include/asm/cmpxchg.h:69:29: sparse: sparse: shift too big (32) for type int arch/openrisc/include/asm/cmpxchg.h:69:29: sparse: sparse: shift too big (32) for type int arch/openrisc/include/asm/cmpxchg.h:69:29: sparse: sparse: shift too big (32) for type int arch/openrisc/include/asm/cmpxchg.h:69:29: sparse: sparse: shift too big (32) for type int arch/openrisc/include/asm/cmpxchg.h:69:29: sparse: sparse: shift too big (32) for type int arch/openrisc/include/asm/cmpxchg.h:69:29: sparse: sparse: shift too big (32) for type int arch/openrisc/include/asm/cmpxchg.h:69:29: sparse: sparse: shift too big (32) for type int arch/openrisc/include/asm/cmpxchg.h:69:29: sparse: sparse: shift too big (32) for type int arch/openrisc/include/asm/cmpxchg.h:69:29: sparse: sparse: shift too big (32) for type int arch/openrisc/include/asm/cmpxchg.h:69:29: sparse: sparse: shift too big (32) for type int arch/openrisc/include/asm/cmpxchg.h:69:29: sparse: sparse: shift too big (32) for type int arch/openrisc/include/asm/cmpxchg.h:69:29: sparse: sparse: shift too big (32) for type int arch/openrisc/include/asm/cmpxchg.h:69:29: sparse: sparse: shift too big (32) for type int arch/openrisc/include/asm/cmpxchg.h:69:29: sparse: sparse: shift too big (32) for type int arch/openrisc/include/asm/cmpxchg.h:69:29: sparse: sparse: shift too big (32) for type int arch/openrisc/include/asm/cmpxchg.h:69:29: sparse: sparse: shift too big (32) for type int arch/openrisc/include/asm/cmpxchg.h:69:29: sparse: sparse: shift too big (32) for type int arch/openrisc/include/asm/cmpxchg.h:69:29: sparse: sparse: shift too big (32) for type int arch/openrisc/include/asm/cmpxchg.h:69:29: sparse: sparse: shift too big (32) for type int arch/openrisc/include/asm/cmpxchg.h:69:29: sparse: sparse: shift too big (32) for type int security/apparmor/lsm.c: note: in included file (through include/linux/sched/task.h, include/linux/sched/signal.h, include/linux/rcuwait.h, ...): include/linux/uaccess.h:131:38: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *to @@ got void [noderef] __user *to @@ include/linux/uaccess.h:131:38: sparse: expected void *to include/linux/uaccess.h:131:38: sparse: got void [noderef] __user *to include/linux/uaccess.h:131:42: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const [noderef] __user *from @@ got void const *from @@ include/linux/uaccess.h:131:42: sparse: expected void const [noderef] __user *from include/linux/uaccess.h:131:42: sparse: got void const *from security/apparmor/lsm.c: note: in included file (through include/linux/uaccess.h, include/linux/sched/task.h, include/linux/sched/signal.h, ...): arch/openrisc/include/asm/uaccess.h:246:55: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const *from @@ got void const [noderef] __user *from @@ arch/openrisc/include/asm/uaccess.h:246:55: sparse: expected void const *from arch/openrisc/include/asm/uaccess.h:246:55: sparse: got void const [noderef] __user *from security/apparmor/lsm.c: note: in included file (through include/asm-generic/atomic.h, arch/openrisc/include/asm/atomic.h, include/linux/atomic.h, ...): arch/openrisc/include/asm/cmpxchg.h:69:29: sparse: sparse: shift too big (32) for type int -- >> drivers/watchdog/pcwd_usb.c:375:37: sparse: sparse: incorrect type in >> initializer (different address spaces) @@ expected char const *__gu_addr >> @@ got char const [noderef] __user * @@ drivers/watchdog/pcwd_usb.c:375:37: sparse: expected char const *__gu_addr >> drivers/watchdog/pcwd_usb.c:375:37: sparse: got char const [noderef] >> __user * >> drivers/watchdog/pcwd_usb.c:407:24: sparse: sparse: incorrect type in >> initializer (different address spaces) @@ expected int *__pu_addr @@ >> got int [noderef] __user *p @@ drivers/watchdog/pcwd_usb.c:407:24: sparse: expected int *__pu_addr >> drivers/watchdog/pcwd_usb.c:407:24: sparse: got int [noderef] __user *p drivers/watchdog/pcwd_usb.c:416:24: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected int *__pu_addr @@ got int [noderef] __user *p @@ drivers/watchdog/pcwd_usb.c:416:24: sparse: expected int *__pu_addr drivers/watchdog/pcwd_usb.c:416:24: sparse: got int [noderef] __user *p >> drivers/watchdog/pcwd_usb.c:423:21: sparse: sparse: incorrect type in >> initializer (different address spaces) @@ expected int const *__gu_addr >> @@ got int [noderef] __user *p @@ drivers/watchdog/pcwd_usb.c:423:21: sparse: expected int const *__gu_addr drivers/watchdog/pcwd_usb.c:423:21: sparse: got int [noderef] __user *p drivers/watchdog/pcwd_usb.c:447:21: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected int const *__gu_addr @@ got int [noderef] __user *p @@ drivers/watchdog/pcwd_usb.c:447:21: sparse: expected int const *__gu_addr drivers/watchdog/pcwd_usb.c:447:21: sparse: got int [noderef] __user *p drivers/watchdog/pcwd_usb.c:458:24: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected int *__pu_addr @@ got int [noderef] __user *p @@ drivers/watchdog/pcwd_usb.c:458:24: sparse: expected int *__pu_addr drivers/watchdog/pcwd_usb.c:458:24: sparse: got int [noderef] __user *p drivers/watchdog/pcwd_usb.c:467:24: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected int *__pu_addr @@ got int [noderef] __user *p @@ drivers/watchdog/pcwd_usb.c:467:24: sparse: expected int *__pu_addr drivers/watchdog/pcwd_usb.c:467:24: sparse: got int [noderef] __user *p drivers/watchdog/pcwd_usb.c: note: in included file (through include/linux/sched/task.h, include/linux/sched/signal.h, include/linux/rcuwait.h, ...): include/linux/uaccess.h:131:38: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *to @@ got void [noderef] __user *to @@ include/linux/uaccess.h:131:38: sparse: expected void *to include/linux/uaccess.h:131:38: sparse: got void [noderef] __user *to include/linux/uaccess.h:131:42: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const [noderef] __user *from @@ got void const *from @@ include/linux/uaccess.h:131:42: sparse: expected void const [noderef] __user *from include/linux/uaccess.h:131:42: sparse: got void const *from drivers/watchdog/pcwd_usb.c: note: in included file (through include/linux/uaccess.h, include/linux/sched/task.h, include/linux/sched/signal.h, ...): arch/openrisc/include/asm/uaccess.h:246:55: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const *from @@ got void const [noderef] __user *from @@ arch/openrisc/include/asm/uaccess.h:246:55: sparse: expected void const *from arch/openrisc/include/asm/uaccess.h:246:55: sparse: got void const [noderef] __user *from drivers/watchdog/pcwd_usb.c: note: in included file (through include/linux/sched/task.h, include/linux/sched/signal.h, include/linux/rcuwait.h, ...): include/linux/uaccess.h:131:38: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *to @@ got void [noderef] __user *to @@ include/linux/uaccess.h:131:38: sparse: expected void *to include/linux/uaccess.h:131:38: sparse: got void [noderef] __user *to include/linux/uaccess.h:131:42: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const [noderef] __user *from @@ got void const *from @@ include/linux/uaccess.h:131:42: sparse: expected void const [noderef] __user *from include/linux/uaccess.h:131:42: sparse: got void const *from drivers/watchdog/pcwd_usb.c: note: in included file (through include/linux/uaccess.h, include/linux/sched/task.h, include/linux/sched/signal.h, ...): arch/openrisc/include/asm/uaccess.h:246:55: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const *from @@ got void const [noderef] __user *from @@ arch/openrisc/include/asm/uaccess.h:246:55: sparse: expected void const *from arch/openrisc/include/asm/uaccess.h:246:55: sparse: got void const [noderef] __user *from vim +1101 security/apparmor/lsm.c 56974a6fcfef69e John Johansen 2017-07-18 1066 56974a6fcfef69e John Johansen 2017-07-18 1067 /** 56974a6fcfef69e John Johansen 2017-07-18 1068 * apparmor_socket_getpeersec_stream - get security context of peer 56974a6fcfef69e John Johansen 2017-07-18 1069 * 56974a6fcfef69e John Johansen 2017-07-18 1070 * Note: for tcp only valid if using ipsec or cipso on lan 56974a6fcfef69e John Johansen 2017-07-18 1071 */ 56974a6fcfef69e John Johansen 2017-07-18 1072 static int apparmor_socket_getpeersec_stream(struct socket *sock, 56974a6fcfef69e John Johansen 2017-07-18 1073 char __user *optval, 56974a6fcfef69e John Johansen 2017-07-18 1074 int __user *optlen, 56974a6fcfef69e John Johansen 2017-07-18 1075 unsigned int len) 56974a6fcfef69e John Johansen 2017-07-18 1076 { 56974a6fcfef69e John Johansen 2017-07-18 1077 char *name; 56974a6fcfef69e John Johansen 2017-07-18 1078 int slen, error = 0; 56974a6fcfef69e John Johansen 2017-07-18 1079 struct aa_label *label; 56974a6fcfef69e John Johansen 2017-07-18 1080 struct aa_label *peer; 56974a6fcfef69e John Johansen 2017-07-18 1081 56974a6fcfef69e John Johansen 2017-07-18 1082 label = begin_current_label_crit_section(); 56974a6fcfef69e John Johansen 2017-07-18 1083 peer = sk_peer_label(sock->sk); 56974a6fcfef69e John Johansen 2017-07-18 1084 if (IS_ERR(peer)) { 56974a6fcfef69e John Johansen 2017-07-18 1085 error = PTR_ERR(peer); 56974a6fcfef69e John Johansen 2017-07-18 1086 goto done; 56974a6fcfef69e John Johansen 2017-07-18 1087 } 56974a6fcfef69e John Johansen 2017-07-18 1088 slen = aa_label_asxprint(&name, labels_ns(label), peer, 56974a6fcfef69e John Johansen 2017-07-18 1089 FLAG_SHOW_MODE | FLAG_VIEW_SUBNS | 56974a6fcfef69e John Johansen 2017-07-18 1090 FLAG_HIDDEN_UNCONFINED, GFP_KERNEL); 56974a6fcfef69e John Johansen 2017-07-18 1091 /* don't include terminating \0 in slen, it breaks some apps */ 56974a6fcfef69e John Johansen 2017-07-18 1092 if (slen < 0) { 56974a6fcfef69e John Johansen 2017-07-18 1093 error = -ENOMEM; 56974a6fcfef69e John Johansen 2017-07-18 1094 } else { 56974a6fcfef69e John Johansen 2017-07-18 1095 if (slen > len) { 56974a6fcfef69e John Johansen 2017-07-18 1096 error = -ERANGE; 56974a6fcfef69e John Johansen 2017-07-18 1097 } else if (copy_to_user(optval, name, slen)) { 56974a6fcfef69e John Johansen 2017-07-18 1098 error = -EFAULT; 56974a6fcfef69e John Johansen 2017-07-18 1099 goto out; 56974a6fcfef69e John Johansen 2017-07-18 1100 } 56974a6fcfef69e John Johansen 2017-07-18 @1101 if (put_user(slen, optlen)) 56974a6fcfef69e John Johansen 2017-07-18 1102 error = -EFAULT; 56974a6fcfef69e John Johansen 2017-07-18 1103 out: 56974a6fcfef69e John Johansen 2017-07-18 1104 kfree(name); 56974a6fcfef69e John Johansen 2017-07-18 1105 56974a6fcfef69e John Johansen 2017-07-18 1106 } 56974a6fcfef69e John Johansen 2017-07-18 1107 56974a6fcfef69e John Johansen 2017-07-18 1108 done: 56974a6fcfef69e John Johansen 2017-07-18 1109 end_current_label_crit_section(label); 56974a6fcfef69e John Johansen 2017-07-18 1110 56974a6fcfef69e John Johansen 2017-07-18 1111 return error; 56974a6fcfef69e John Johansen 2017-07-18 1112 } 56974a6fcfef69e John Johansen 2017-07-18 1113 :::::: The code at line 1101 was first introduced by commit :::::: 56974a6fcfef69ee0825bd66ed13e92070ac5224 apparmor: add base infastructure for socket mediation :::::: TO: John Johansen <john.johan...@canonical.com> :::::: CC: John Johansen <john.johan...@canonical.com> --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-...@lists.01.org
.config.gz
Description: application/gzip