[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202007090533.9aGXcIll%lkp@intel.com>
Date: Thu, 9 Jul 2020 05:33:36 +0800
From: kernel test robot <lkp@...el.com>
To: Luc Van Oostenryck <luc.vanoostenryck@...il.com>
Cc: kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org
Subject: kernel/bpf/syscall.c:1384:13: sparse: sparse: incorrect type in
initializer (different address spaces)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: dcde237b9b0eb1d19306e6f48c0a4e058907619f
commit: 670d0a4b10704667765f7d18f7592993d02783aa sparse: use identifiers to define address spaces
date: 3 weeks ago
config: openrisc-randconfig-s032-20200709 (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-37-gc9676a3b-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 <lkp@...el.com>
sparse warnings: (new ones prefixed by >>)
>> kernel/bpf/syscall.c:1384:13: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected unsigned int *__pu_addr @@ got unsigned int [noderef] __user * @@
kernel/bpf/syscall.c:1384:13: sparse: expected unsigned int *__pu_addr
>> kernel/bpf/syscall.c:1384:13: sparse: got unsigned int [noderef] __user *
>> kernel/bpf/syscall.c:2648:21: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected char *__pu_addr @@ got char [noderef] __user * @@
kernel/bpf/syscall.c:2648:21: sparse: expected char *__pu_addr
>> kernel/bpf/syscall.c:2648:21: sparse: got char [noderef] __user *
kernel/bpf/syscall.c:3014:23: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected unsigned int *__pu_addr @@ got unsigned int [noderef] __user * @@
kernel/bpf/syscall.c:3014:23: sparse: expected unsigned int *__pu_addr
kernel/bpf/syscall.c:3014:23: sparse: got unsigned int [noderef] __user *
>> kernel/bpf/syscall.c:3263:29: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected unsigned int *__pu_addr @@ got unsigned int [noderef] [usertype] __user * @@
kernel/bpf/syscall.c:3263:29: sparse: expected unsigned int *__pu_addr
>> kernel/bpf/syscall.c:3263:29: sparse: got unsigned int [noderef] [usertype] __user *
>> kernel/bpf/syscall.c:3380:45: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected unsigned long long *__pu_addr @@ got unsigned long long [noderef] [usertype] __user * @@
kernel/bpf/syscall.c:3380:45: sparse: expected unsigned long long *__pu_addr
>> kernel/bpf/syscall.c:3380:45: sparse: got unsigned long long [noderef] [usertype] __user *
kernel/bpf/syscall.c:3386:37: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected unsigned long long *__pu_addr @@ got unsigned long long [noderef] [usertype] __user * @@
kernel/bpf/syscall.c:3386:37: sparse: expected unsigned long long *__pu_addr
kernel/bpf/syscall.c:3386:37: sparse: got unsigned long long [noderef] [usertype] __user *
kernel/bpf/syscall.c:3408:45: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected unsigned int *__pu_addr @@ got unsigned int [noderef] [usertype] __user * @@
kernel/bpf/syscall.c:3408:45: sparse: expected unsigned int *__pu_addr
kernel/bpf/syscall.c:3408:45: sparse: got unsigned int [noderef] [usertype] __user *
kernel/bpf/syscall.c:3413:37: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected unsigned int *__pu_addr @@ got unsigned int [noderef] [usertype] __user * @@
kernel/bpf/syscall.c:3413:37: sparse: expected unsigned int *__pu_addr
kernel/bpf/syscall.c:3413:37: sparse: got unsigned int [noderef] [usertype] __user *
kernel/bpf/syscall.c:3461:37: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected unsigned long long *__pu_addr @@ got unsigned long long [noderef] [usertype] __user * @@
kernel/bpf/syscall.c:3461:37: sparse: expected unsigned long long *__pu_addr
kernel/bpf/syscall.c:3461:37: sparse: got unsigned long long [noderef] [usertype] __user *
kernel/bpf/syscall.c:3494:13: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected unsigned int *__pu_addr @@ got unsigned int [noderef] __user * @@
kernel/bpf/syscall.c:3494:13: sparse: expected unsigned int *__pu_addr
kernel/bpf/syscall.c:3494:13: sparse: got unsigned int [noderef] __user *
kernel/bpf/syscall.c:3537:13: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected unsigned int *__pu_addr @@ got unsigned int [noderef] __user * @@
kernel/bpf/syscall.c:3537:13: sparse: expected unsigned int *__pu_addr
kernel/bpf/syscall.c:3537:13: sparse: got unsigned int [noderef] __user *
kernel/bpf/syscall.c:3587:13: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected unsigned int *__pu_addr @@ got unsigned int [noderef] __user * @@
kernel/bpf/syscall.c:3587:13: sparse: expected unsigned int *__pu_addr
kernel/bpf/syscall.c:3587:13: sparse: got unsigned int [noderef] __user *
kernel/bpf/syscall.c:3664:13: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected unsigned int *__pu_addr @@ got unsigned int [noderef] __user * @@
kernel/bpf/syscall.c:3664:13: sparse: expected unsigned int *__pu_addr
kernel/bpf/syscall.c:3664:13: sparse: got unsigned int [noderef] __user *
>> kernel/bpf/syscall.c:3672:29: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected char *__pu_addr @@ got char [noderef] __user *ubuf @@
kernel/bpf/syscall.c:3672:29: sparse: expected char *__pu_addr
>> kernel/bpf/syscall.c:3672:29: sparse: got char [noderef] __user *ubuf
kernel/bpf/syscall.c:3687:29: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected char *__pu_addr @@ got char [noderef] __user * @@
kernel/bpf/syscall.c:3687:29: sparse: expected char *__pu_addr
kernel/bpf/syscall.c:3687:29: sparse: got char [noderef] __user *
kernel/bpf/syscall.c:3692:13: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected unsigned int *__pu_addr @@ got unsigned int [noderef] __user * @@
kernel/bpf/syscall.c:3692:13: sparse: expected unsigned int *__pu_addr
kernel/bpf/syscall.c:3692:13: sparse: got unsigned int [noderef] __user *
kernel/bpf/syscall.c:3693:13: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected unsigned int *__pu_addr @@ got unsigned int [noderef] __user * @@
kernel/bpf/syscall.c:3693:13: sparse: expected unsigned int *__pu_addr
kernel/bpf/syscall.c:3693:13: sparse: got unsigned int [noderef] __user *
>> kernel/bpf/syscall.c:3694:13: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected unsigned long long *__pu_addr @@ got unsigned long long [noderef] __user * @@
kernel/bpf/syscall.c:3694:13: sparse: expected unsigned long long *__pu_addr
>> kernel/bpf/syscall.c:3694:13: sparse: got unsigned long long [noderef] __user *
kernel/bpf/syscall.c:3695:13: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected unsigned long long *__pu_addr @@ got unsigned long long [noderef] __user * @@
kernel/bpf/syscall.c:3695:13: sparse: expected unsigned long long *__pu_addr
kernel/bpf/syscall.c:3695:13: sparse: got unsigned long long [noderef] __user *
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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 @@
--
>> kernel/bpf/verifier.c:299:13: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected char *__pu_addr @@ got char [noderef] __user * @@
kernel/bpf/verifier.c:299:13: sparse: expected char *__pu_addr
>> kernel/bpf/verifier.c:299:13: sparse: got char [noderef] __user *
>> kernel/bpf/verifier.c:7595:37: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected unsigned int *__pu_addr @@ got unsigned int [noderef] __user * @@
kernel/bpf/verifier.c:7595:37: sparse: expected unsigned int *__pu_addr
>> kernel/bpf/verifier.c:7595:37: sparse: got unsigned int [noderef] __user *
kernel/bpf/verifier.c:7712:37: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected unsigned int *__pu_addr @@ got unsigned int [noderef] __user * @@
kernel/bpf/verifier.c:7712:37: sparse: expected unsigned int *__pu_addr
kernel/bpf/verifier.c:7712:37: sparse: got unsigned int [noderef] __user *
kernel/bpf/verifier.c:9897:76: sparse: sparse: subtraction of functions? Share your drugs
kernel/bpf/verifier.c:10272:81: sparse: sparse: subtraction of functions? Share your drugs
kernel/bpf/verifier.c:10276:81: sparse: sparse: subtraction of functions? Share your drugs
kernel/bpf/verifier.c:10280:81: sparse: sparse: subtraction of functions? Share your drugs
kernel/bpf/verifier.c:10284:79: sparse: sparse: subtraction of functions? Share your drugs
kernel/bpf/verifier.c:10288:78: sparse: sparse: subtraction of functions? Share your drugs
kernel/bpf/verifier.c:10292:79: sparse: sparse: subtraction of functions? Share your drugs
kernel/bpf/verifier.c:10335:38: sparse: sparse: subtraction of functions? Share your drugs
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
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
--
kernel/bpf/hashtab.c:622:19: sparse: sparse: subtraction of functions? Share your drugs
kernel/bpf/hashtab.c:663:19: sparse: sparse: subtraction of functions? Share your drugs
kernel/bpf/hashtab.c:1347:24: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void *ubatch @@ got void [noderef] __user * @@
kernel/bpf/hashtab.c:1347:24: sparse: expected void *ubatch
kernel/bpf/hashtab.c:1347:24: sparse: got void [noderef] __user *
>> kernel/bpf/hashtab.c:1372:13: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected unsigned int *__pu_addr @@ got unsigned int [noderef] __user * @@
kernel/bpf/hashtab.c:1372:13: sparse: expected unsigned int *__pu_addr
>> kernel/bpf/hashtab.c:1372:13: sparse: got unsigned int [noderef] __user *
kernel/bpf/hashtab.c:1376:46: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const [noderef] __user *from @@ got void *ubatch @@
kernel/bpf/hashtab.c:1376:46: sparse: expected void const [noderef] __user *from
kernel/bpf/hashtab.c:1376:46: sparse: got void *ubatch
kernel/bpf/hashtab.c:1537:16: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected void *ubatch @@ got void [noderef] __user * @@
kernel/bpf/hashtab.c:1537:16: sparse: expected void *ubatch
kernel/bpf/hashtab.c:1537:16: sparse: got void [noderef] __user *
kernel/bpf/hashtab.c:1538:26: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void [noderef] __user *to @@ got void *ubatch @@
kernel/bpf/hashtab.c:1538:26: sparse: expected void [noderef] __user *to
kernel/bpf/hashtab.c:1538:26: sparse: got void *ubatch
kernel/bpf/hashtab.c:1539:13: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected unsigned int *__pu_addr @@ got unsigned int [noderef] __user * @@
kernel/bpf/hashtab.c:1539:13: sparse: expected unsigned int *__pu_addr
kernel/bpf/hashtab.c:1539:13: sparse: got unsigned int [noderef] __user *
kernel/bpf/hashtab.c:1874:19: sparse: sparse: subtraction of functions? Share your drugs
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
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
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
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
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
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
kernel/bpf/hashtab.c:1409:9: sparse: sparse: context imbalance in '__htab_map_lookup_and_delete_batch' - different lock contexts for basic block
--
>> kernel/bpf/btf.c:4671:13: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected unsigned int *__pu_addr @@ got unsigned int [noderef] __user * @@
kernel/bpf/btf.c:4671:13: sparse: expected unsigned int *__pu_addr
>> kernel/bpf/btf.c:4671:13: sparse: got unsigned int [noderef] __user *
include/linux/bpf_types.h:35:1: sparse: sparse: Initializer entry defined twice
kernel/bpf/btf.c:3509:9: sparse: also defined here
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
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
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
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
arch/openrisc/include/asm/cmpxchg.h:69:29: sparse: sparse: shift too big (32) for type int
--
kernel/bpf/cgroup.c:1402:21: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected int const *__gu_addr @@ got int [noderef] __user *optlen @@
kernel/bpf/cgroup.c:1402:21: sparse: expected int const *__gu_addr
kernel/bpf/cgroup.c:1402:21: sparse: got int [noderef] __user *optlen
>> kernel/bpf/cgroup.c:1440:13: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected int *__pu_addr @@ got int [noderef] __user *optlen @@
kernel/bpf/cgroup.c:1440:13: sparse: expected int *__pu_addr
kernel/bpf/cgroup.c:1440:13: sparse: got int [noderef] __user *optlen
arch/openrisc/include/asm/cmpxchg.h:101:29: sparse: sparse: shift too big (32) for type int
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
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
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
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
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
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
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
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/spi/spidev.c:374:26: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected unsigned char *__pu_addr @@ got unsigned char [noderef] [usertype] __user * @@
drivers/spi/spidev.c:374:26: sparse: expected unsigned char *__pu_addr
drivers/spi/spidev.c:374:26: sparse: got unsigned char [noderef] [usertype] __user *
>> drivers/spi/spidev.c:378:26: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected unsigned int *__pu_addr @@ got unsigned int [noderef] [usertype] __user * @@
drivers/spi/spidev.c:378:26: sparse: expected unsigned int *__pu_addr
drivers/spi/spidev.c:378:26: sparse: got unsigned int [noderef] [usertype] __user *
drivers/spi/spidev.c:382:26: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected unsigned char *__pu_addr @@ got unsigned char [noderef] [usertype] __user * @@
drivers/spi/spidev.c:382:26: sparse: expected unsigned char *__pu_addr
drivers/spi/spidev.c:382:26: sparse: got unsigned char [noderef] [usertype] __user *
drivers/spi/spidev.c:386:26: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected unsigned char *__pu_addr @@ got unsigned char [noderef] [usertype] __user * @@
drivers/spi/spidev.c:386:26: sparse: expected unsigned char *__pu_addr
drivers/spi/spidev.c:386:26: sparse: got unsigned char [noderef] [usertype] __user *
drivers/spi/spidev.c:389:26: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected unsigned int *__pu_addr @@ got unsigned int [noderef] [usertype] __user * @@
drivers/spi/spidev.c:389:26: sparse: expected unsigned int *__pu_addr
drivers/spi/spidev.c:389:26: sparse: got unsigned int [noderef] [usertype] __user *
drivers/spi/spidev.c:396:34: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected unsigned char const *__gu_addr @@ got unsigned char [noderef] [usertype] __user * @@
drivers/spi/spidev.c:396:34: sparse: expected unsigned char const *__gu_addr
drivers/spi/spidev.c:396:34: sparse: got unsigned char [noderef] [usertype] __user *
drivers/spi/spidev.c:398:34: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected unsigned int const *__gu_addr @@ got unsigned int [noderef] [usertype] __user * @@
drivers/spi/spidev.c:398:34: sparse: expected unsigned int const *__gu_addr
drivers/spi/spidev.c:398:34: sparse: got unsigned int [noderef] [usertype] __user *
drivers/spi/spidev.c:422:26: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected unsigned char const *__gu_addr @@ got unsigned char [noderef] [usertype] __user * @@
drivers/spi/spidev.c:422:26: sparse: expected unsigned char const *__gu_addr
drivers/spi/spidev.c:422:26: sparse: got unsigned char [noderef] [usertype] __user *
drivers/spi/spidev.c:439:26: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected unsigned char const *__gu_addr @@ got unsigned char [noderef] [usertype] __user * @@
drivers/spi/spidev.c:439:26: sparse: expected unsigned char const *__gu_addr
drivers/spi/spidev.c:439:26: sparse: got unsigned char [noderef] [usertype] __user *
drivers/spi/spidev.c:452:26: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected unsigned int const *__gu_addr @@ got unsigned int [noderef] [usertype] __user * @@
drivers/spi/spidev.c:452:26: sparse: expected unsigned int const *__gu_addr
drivers/spi/spidev.c:452:26: sparse: got unsigned int [noderef] [usertype] __user *
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
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
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
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/rtc/rtc-m41t80.c:731:24: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected int *__pu_addr @@ got int [noderef] __user * @@
drivers/rtc/rtc-m41t80.c:731:24: sparse: expected int *__pu_addr
>> drivers/rtc/rtc-m41t80.c:731:24: sparse: got int [noderef] __user *
>> drivers/rtc/rtc-m41t80.c:736:21: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected int const *__gu_addr @@ got int [noderef] __user * @@
drivers/rtc/rtc-m41t80.c:736:21: sparse: expected int const *__gu_addr
drivers/rtc/rtc-m41t80.c:736:21: sparse: got int [noderef] __user *
drivers/rtc/rtc-m41t80.c:745:24: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected int *__pu_addr @@ got int [noderef] __user * @@
drivers/rtc/rtc-m41t80.c:745:24: sparse: expected int *__pu_addr
drivers/rtc/rtc-m41t80.c:745:24: sparse: got int [noderef] __user *
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
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/usb/gadget/udc/mv_u3d_core.c:47:33: sparse: sparse: incorrect type in initializer (different base types) @@ expected restricted __le16 [usertype] wMaxPacketSize @@ got int @@
drivers/usb/gadget/udc/mv_u3d_core.c:47:33: sparse: expected restricted __le16 [usertype] wMaxPacketSize
drivers/usb/gadget/udc/mv_u3d_core.c:47:33: sparse: got int
drivers/usb/gadget/udc/mv_u3d_core.c:241:35: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] rsvd0 @@ got restricted __le32 [usertype] @@
drivers/usb/gadget/udc/mv_u3d_core.c:241:35: sparse: expected unsigned int [usertype] rsvd0
drivers/usb/gadget/udc/mv_u3d_core.c:241:35: sparse: got restricted __le32 [usertype]
drivers/usb/gadget/udc/mv_u3d_core.c:247:41: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] trb_addr_lo @@ got restricted __le32 [usertype] @@
drivers/usb/gadget/udc/mv_u3d_core.c:247:41: sparse: expected unsigned int [usertype] trb_addr_lo
drivers/usb/gadget/udc/mv_u3d_core.c:247:41: sparse: got restricted __le32 [usertype]
drivers/usb/gadget/udc/mv_u3d_core.c:305:29: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] buf_addr_lo @@ got restricted __le32 [usertype] @@
drivers/usb/gadget/udc/mv_u3d_core.c:305:29: sparse: expected unsigned int [usertype] buf_addr_lo
drivers/usb/gadget/udc/mv_u3d_core.c:305:29: sparse: got restricted __le32 [usertype]
drivers/usb/gadget/udc/mv_u3d_core.c:307:25: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] trb_len @@ got restricted __le32 [usertype] @@
drivers/usb/gadget/udc/mv_u3d_core.c:307:25: sparse: expected unsigned int [usertype] trb_len
drivers/usb/gadget/udc/mv_u3d_core.c:307:25: sparse: got restricted __le32 [usertype]
drivers/usb/gadget/udc/mv_u3d_core.c:351:34: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] buf_addr_lo @@ got restricted __le32 [usertype] @@
drivers/usb/gadget/udc/mv_u3d_core.c:351:34: sparse: expected unsigned int [usertype] buf_addr_lo
drivers/usb/gadget/udc/mv_u3d_core.c:351:34: sparse: got restricted __le32 [usertype]
drivers/usb/gadget/udc/mv_u3d_core.c:353:30: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] trb_len @@ got restricted __le32 [usertype] @@
drivers/usb/gadget/udc/mv_u3d_core.c:353:30: sparse: expected unsigned int [usertype] trb_len
drivers/usb/gadget/udc/mv_u3d_core.c:353:30: sparse: got restricted __le32 [usertype]
drivers/usb/gadget/udc/mv_u3d_core.c:889:42: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void [noderef] __iomem * @@ got unsigned int * @@
drivers/usb/gadget/udc/mv_u3d_core.c:889:42: sparse: expected void [noderef] __iomem *
drivers/usb/gadget/udc/mv_u3d_core.c:889:42: sparse: got unsigned int *
drivers/usb/gadget/udc/mv_u3d_core.c:1478:26: sparse: sparse: cast from restricted __le16
>> drivers/usb/gadget/udc/mv_u3d_core.c:1770:28: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *addr @@ got struct mv_u3d_cap_regs [noderef] __iomem *cap_regs @@
drivers/usb/gadget/udc/mv_u3d_core.c:1770:28: sparse: expected void *addr
>> drivers/usb/gadget/udc/mv_u3d_core.c:1770:28: sparse: got struct mv_u3d_cap_regs [noderef] __iomem *cap_regs
drivers/usb/gadget/udc/mv_u3d_core.c:1981:20: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *addr @@ got struct mv_u3d_cap_regs [noderef] __iomem *cap_regs @@
drivers/usb/gadget/udc/mv_u3d_core.c:1981:20: sparse: expected void *addr
drivers/usb/gadget/udc/mv_u3d_core.c:1981:20: sparse: got struct mv_u3d_cap_regs [noderef] __iomem *cap_regs
vim +1384 kernel/bpf/syscall.c
cb4d03ab499d4c Brian Vazquez 2020-01-15 1358
cb4d03ab499d4c Brian Vazquez 2020-01-15 1359 int generic_map_lookup_batch(struct bpf_map *map,
cb4d03ab499d4c Brian Vazquez 2020-01-15 1360 const union bpf_attr *attr,
cb4d03ab499d4c Brian Vazquez 2020-01-15 1361 union bpf_attr __user *uattr)
cb4d03ab499d4c Brian Vazquez 2020-01-15 1362 {
cb4d03ab499d4c Brian Vazquez 2020-01-15 1363 void __user *uobatch = u64_to_user_ptr(attr->batch.out_batch);
cb4d03ab499d4c Brian Vazquez 2020-01-15 1364 void __user *ubatch = u64_to_user_ptr(attr->batch.in_batch);
cb4d03ab499d4c Brian Vazquez 2020-01-15 1365 void __user *values = u64_to_user_ptr(attr->batch.values);
cb4d03ab499d4c Brian Vazquez 2020-01-15 1366 void __user *keys = u64_to_user_ptr(attr->batch.keys);
cb4d03ab499d4c Brian Vazquez 2020-01-15 1367 void *buf, *buf_prevkey, *prev_key, *key, *value;
cb4d03ab499d4c Brian Vazquez 2020-01-15 1368 int err, retry = MAP_LOOKUP_RETRIES;
cb4d03ab499d4c Brian Vazquez 2020-01-15 1369 u32 value_size, cp, max_count;
cb4d03ab499d4c Brian Vazquez 2020-01-15 1370
cb4d03ab499d4c Brian Vazquez 2020-01-15 1371 if (attr->batch.elem_flags & ~BPF_F_LOCK)
cb4d03ab499d4c Brian Vazquez 2020-01-15 1372 return -EINVAL;
cb4d03ab499d4c Brian Vazquez 2020-01-15 1373
cb4d03ab499d4c Brian Vazquez 2020-01-15 1374 if ((attr->batch.elem_flags & BPF_F_LOCK) &&
cb4d03ab499d4c Brian Vazquez 2020-01-15 1375 !map_value_has_spin_lock(map))
cb4d03ab499d4c Brian Vazquez 2020-01-15 1376 return -EINVAL;
cb4d03ab499d4c Brian Vazquez 2020-01-15 1377
cb4d03ab499d4c Brian Vazquez 2020-01-15 1378 value_size = bpf_map_value_size(map);
cb4d03ab499d4c Brian Vazquez 2020-01-15 1379
cb4d03ab499d4c Brian Vazquez 2020-01-15 1380 max_count = attr->batch.count;
cb4d03ab499d4c Brian Vazquez 2020-01-15 1381 if (!max_count)
cb4d03ab499d4c Brian Vazquez 2020-01-15 1382 return 0;
cb4d03ab499d4c Brian Vazquez 2020-01-15 1383
cb4d03ab499d4c Brian Vazquez 2020-01-15 @1384 if (put_user(0, &uattr->batch.count))
cb4d03ab499d4c Brian Vazquez 2020-01-15 1385 return -EFAULT;
cb4d03ab499d4c Brian Vazquez 2020-01-15 1386
cb4d03ab499d4c Brian Vazquez 2020-01-15 1387 buf_prevkey = kmalloc(map->key_size, GFP_USER | __GFP_NOWARN);
cb4d03ab499d4c Brian Vazquez 2020-01-15 1388 if (!buf_prevkey)
cb4d03ab499d4c Brian Vazquez 2020-01-15 1389 return -ENOMEM;
cb4d03ab499d4c Brian Vazquez 2020-01-15 1390
cb4d03ab499d4c Brian Vazquez 2020-01-15 1391 buf = kmalloc(map->key_size + value_size, GFP_USER | __GFP_NOWARN);
cb4d03ab499d4c Brian Vazquez 2020-01-15 1392 if (!buf) {
bb2359f4dbe98e Denis Efremov 2020-06-01 1393 kfree(buf_prevkey);
cb4d03ab499d4c Brian Vazquez 2020-01-15 1394 return -ENOMEM;
cb4d03ab499d4c Brian Vazquez 2020-01-15 1395 }
cb4d03ab499d4c Brian Vazquez 2020-01-15 1396
cb4d03ab499d4c Brian Vazquez 2020-01-15 1397 err = -EFAULT;
cb4d03ab499d4c Brian Vazquez 2020-01-15 1398 prev_key = NULL;
cb4d03ab499d4c Brian Vazquez 2020-01-15 1399 if (ubatch && copy_from_user(buf_prevkey, ubatch, map->key_size))
cb4d03ab499d4c Brian Vazquez 2020-01-15 1400 goto free_buf;
cb4d03ab499d4c Brian Vazquez 2020-01-15 1401 key = buf;
cb4d03ab499d4c Brian Vazquez 2020-01-15 1402 value = key + map->key_size;
cb4d03ab499d4c Brian Vazquez 2020-01-15 1403 if (ubatch)
cb4d03ab499d4c Brian Vazquez 2020-01-15 1404 prev_key = buf_prevkey;
cb4d03ab499d4c Brian Vazquez 2020-01-15 1405
cb4d03ab499d4c Brian Vazquez 2020-01-15 1406 for (cp = 0; cp < max_count;) {
cb4d03ab499d4c Brian Vazquez 2020-01-15 1407 rcu_read_lock();
cb4d03ab499d4c Brian Vazquez 2020-01-15 1408 err = map->ops->map_get_next_key(map, prev_key, key);
cb4d03ab499d4c Brian Vazquez 2020-01-15 1409 rcu_read_unlock();
cb4d03ab499d4c Brian Vazquez 2020-01-15 1410 if (err)
cb4d03ab499d4c Brian Vazquez 2020-01-15 1411 break;
cb4d03ab499d4c Brian Vazquez 2020-01-15 1412 err = bpf_map_copy_value(map, key, value,
cb4d03ab499d4c Brian Vazquez 2020-01-15 1413 attr->batch.elem_flags);
cb4d03ab499d4c Brian Vazquez 2020-01-15 1414
cb4d03ab499d4c Brian Vazquez 2020-01-15 1415 if (err == -ENOENT) {
cb4d03ab499d4c Brian Vazquez 2020-01-15 1416 if (retry) {
cb4d03ab499d4c Brian Vazquez 2020-01-15 1417 retry--;
cb4d03ab499d4c Brian Vazquez 2020-01-15 1418 continue;
cb4d03ab499d4c Brian Vazquez 2020-01-15 1419 }
cb4d03ab499d4c Brian Vazquez 2020-01-15 1420 err = -EINTR;
cb4d03ab499d4c Brian Vazquez 2020-01-15 1421 break;
cb4d03ab499d4c Brian Vazquez 2020-01-15 1422 }
cb4d03ab499d4c Brian Vazquez 2020-01-15 1423
cb4d03ab499d4c Brian Vazquez 2020-01-15 1424 if (err)
cb4d03ab499d4c Brian Vazquez 2020-01-15 1425 goto free_buf;
cb4d03ab499d4c Brian Vazquez 2020-01-15 1426
cb4d03ab499d4c Brian Vazquez 2020-01-15 1427 if (copy_to_user(keys + cp * map->key_size, key,
cb4d03ab499d4c Brian Vazquez 2020-01-15 1428 map->key_size)) {
cb4d03ab499d4c Brian Vazquez 2020-01-15 1429 err = -EFAULT;
cb4d03ab499d4c Brian Vazquez 2020-01-15 1430 goto free_buf;
cb4d03ab499d4c Brian Vazquez 2020-01-15 1431 }
cb4d03ab499d4c Brian Vazquez 2020-01-15 1432 if (copy_to_user(values + cp * value_size, value, value_size)) {
cb4d03ab499d4c Brian Vazquez 2020-01-15 1433 err = -EFAULT;
cb4d03ab499d4c Brian Vazquez 2020-01-15 1434 goto free_buf;
cb4d03ab499d4c Brian Vazquez 2020-01-15 1435 }
cb4d03ab499d4c Brian Vazquez 2020-01-15 1436
cb4d03ab499d4c Brian Vazquez 2020-01-15 1437 if (!prev_key)
cb4d03ab499d4c Brian Vazquez 2020-01-15 1438 prev_key = buf_prevkey;
cb4d03ab499d4c Brian Vazquez 2020-01-15 1439
cb4d03ab499d4c Brian Vazquez 2020-01-15 1440 swap(prev_key, key);
cb4d03ab499d4c Brian Vazquez 2020-01-15 1441 retry = MAP_LOOKUP_RETRIES;
cb4d03ab499d4c Brian Vazquez 2020-01-15 1442 cp++;
cb4d03ab499d4c Brian Vazquez 2020-01-15 1443 }
cb4d03ab499d4c Brian Vazquez 2020-01-15 1444
cb4d03ab499d4c Brian Vazquez 2020-01-15 1445 if (err == -EFAULT)
cb4d03ab499d4c Brian Vazquez 2020-01-15 1446 goto free_buf;
cb4d03ab499d4c Brian Vazquez 2020-01-15 1447
cb4d03ab499d4c Brian Vazquez 2020-01-15 1448 if ((copy_to_user(&uattr->batch.count, &cp, sizeof(cp)) ||
cb4d03ab499d4c Brian Vazquez 2020-01-15 1449 (cp && copy_to_user(uobatch, prev_key, map->key_size))))
cb4d03ab499d4c Brian Vazquez 2020-01-15 1450 err = -EFAULT;
cb4d03ab499d4c Brian Vazquez 2020-01-15 1451
cb4d03ab499d4c Brian Vazquez 2020-01-15 1452 free_buf:
cb4d03ab499d4c Brian Vazquez 2020-01-15 1453 kfree(buf_prevkey);
cb4d03ab499d4c Brian Vazquez 2020-01-15 1454 kfree(buf);
cb4d03ab499d4c Brian Vazquez 2020-01-15 1455 return err;
cb4d03ab499d4c Brian Vazquez 2020-01-15 1456 }
cb4d03ab499d4c Brian Vazquez 2020-01-15 1457
:::::: The code at line 1384 was first introduced by commit
:::::: cb4d03ab499d4c040f4ab6fd4389d2b49f42b5a5 bpf: Add generic support for lookup batch op
:::::: TO: Brian Vazquez <brianvv@...gle.com>
:::::: CC: Alexei Starovoitov <ast@...nel.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
Download attachment ".config.gz" of type "application/gzip" (21354 bytes)
Powered by blists - more mailing lists