lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202111201220.iqKWiDfb-lkp@intel.com>
Date:   Sat, 20 Nov 2021 12:45:32 +0800
From:   kernel test robot <lkp@...el.com>
To:     Thomas Bogendoerfer <tsbogend@...ha.franken.de>
Cc:     kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org,
        Christoph Hellwig <hch@....de>
Subject: arch/mips/kernel/syscall.c:173:31: sparse: sparse: incorrect type in
 initializer (different address spaces)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   a90af8f15bdc9449ee2d24e1d73fa3f7e8633f81
commit: ddb002d6d6af12c45dd9d565cadf0f40b36b7c25 MIPS: uaccess: Reduce number of nested macros
date:   7 months ago
config: mips-randconfig-s032-20211116 (attached as .config)
compiler: mipsel-linux-gcc (GCC) 11.2.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.4-dirty
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ddb002d6d6af12c45dd9d565cadf0f40b36b7c25
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout ddb002d6d6af12c45dd9d565cadf0f40b36b7c25
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=mips 

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 >>)
   command-line: note: in included file:
   builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_ACQUIRE redefined
   builtin:0:0: sparse: this was the original definition
   builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_SEQ_CST redefined
   builtin:0:0: sparse: this was the original definition
   builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_ACQ_REL redefined
   builtin:0:0: sparse: this was the original definition
   builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_RELEASE redefined
   builtin:0:0: sparse: this was the original definition
>> arch/mips/kernel/syscall.c:173:31: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected unsigned int const [noderef] __user *__gu_ptr @@     got unsigned int * @@
   arch/mips/kernel/syscall.c:173:31: sparse:     expected unsigned int const [noderef] __user *__gu_ptr
   arch/mips/kernel/syscall.c:173:31: sparse:     got unsigned int *
>> arch/mips/kernel/syscall.c:174:32: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected unsigned int [noderef] __user *__pu_ptr @@     got unsigned int * @@
   arch/mips/kernel/syscall.c:174:32: sparse:     expected unsigned int [noderef] __user *__pu_ptr
   arch/mips/kernel/syscall.c:174:32: sparse:     got unsigned int *
--
   command-line: note: in included file:
   builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_ACQUIRE redefined
   builtin:0:0: sparse: this was the original definition
   builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_SEQ_CST redefined
   builtin:0:0: sparse: this was the original definition
   builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_ACQ_REL redefined
   builtin:0:0: sparse: this was the original definition
   builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_RELEASE redefined
   builtin:0:0: sparse: this was the original definition
   arch/mips/kernel/ptrace.c: note: in included file:
>> arch/mips/include/asm/syscall.h:70:17: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected int const [noderef] __user *__p @@     got int * @@
   arch/mips/include/asm/syscall.h:70:17: sparse:     expected int const [noderef] __user *__p
   arch/mips/include/asm/syscall.h:70:17: sparse:     got int *
--
   command-line: note: in included file:
   builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_ACQUIRE redefined
   builtin:0:0: sparse: this was the original definition
   builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_SEQ_CST redefined
   builtin:0:0: sparse: this was the original definition
   builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_ACQ_REL redefined
   builtin:0:0: sparse: this was the original definition
   builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_RELEASE redefined
   builtin:0:0: sparse: this was the original definition
   arch/mips/kernel/signal.c:280:13: sparse: sparse: cast removes address space '__user' of expression
   arch/mips/kernel/signal.c:280:13: sparse: sparse: cast removes address space '__user' of expression
>> arch/mips/kernel/signal.c:280:13: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected unsigned int [noderef] __user *__pu_ptr @@     got unsigned int [usertype] * @@
   arch/mips/kernel/signal.c:280:13: sparse:     expected unsigned int [noderef] __user *__pu_ptr
   arch/mips/kernel/signal.c:280:13: sparse:     got unsigned int [usertype] *
   arch/mips/kernel/signal.c:280:13: sparse: sparse: cast removes address space '__user' of expression
   arch/mips/kernel/signal.c:293:23: sparse: sparse: cast removes address space '__user' of expression
   arch/mips/kernel/signal.c:293:23: sparse: sparse: cast removes address space '__user' of expression
>> arch/mips/kernel/signal.c:293:23: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected unsigned int const [noderef] __user *__gu_ptr @@     got unsigned int * @@
   arch/mips/kernel/signal.c:293:23: sparse:     expected unsigned int const [noderef] __user *__gu_ptr
   arch/mips/kernel/signal.c:293:23: sparse:     got unsigned int *
   arch/mips/kernel/signal.c:300:23: sparse: sparse: cast removes address space '__user' of expression
   arch/mips/kernel/signal.c:300:23: sparse: sparse: cast removes address space '__user' of expression
   arch/mips/kernel/signal.c:300:23: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected unsigned int const [noderef] __user *__gu_ptr @@     got unsigned int * @@
   arch/mips/kernel/signal.c:300:23: sparse:     expected unsigned int const [noderef] __user *__gu_ptr
   arch/mips/kernel/signal.c:300:23: sparse:     got unsigned int *
   arch/mips/kernel/signal.c:630:17: sparse: sparse: symbol 'sys_sigreturn' was not declared. Should it be static?
   arch/mips/kernel/signal.c:667:17: sparse: sparse: symbol 'sys_rt_sigreturn' was not declared. Should it be static?
   arch/mips/kernel/signal.c:157:14: sparse: sparse: cast removes address space '__user' of expression
   arch/mips/kernel/signal.c:157:12: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected struct ucontext [noderef] __user *uc @@     got struct ucontext * @@
   arch/mips/kernel/signal.c:157:12: sparse:     expected struct ucontext [noderef] __user *uc
   arch/mips/kernel/signal.c:157:12: sparse:     got struct ucontext *
   arch/mips/kernel/signal.c:157:14: sparse: sparse: cast removes address space '__user' of expression
   arch/mips/kernel/signal.c:157:12: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected struct ucontext [noderef] __user *uc @@     got struct ucontext * @@
   arch/mips/kernel/signal.c:157:12: sparse:     expected struct ucontext [noderef] __user *uc
   arch/mips/kernel/signal.c:157:12: sparse:     got struct ucontext *
--
   command-line: note: in included file:
   builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_ACQUIRE redefined
   builtin:0:0: sparse: this was the original definition
   builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_SEQ_CST redefined
   builtin:0:0: sparse: this was the original definition
   builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_ACQ_REL redefined
   builtin:0:0: sparse: this was the original definition
   builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_RELEASE redefined
   builtin:0:0: sparse: this was the original definition
   arch/mips/sibyte/common/sb_tbprof.c:449:14: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const [noderef] __user *p @@     got char *buf @@
   arch/mips/sibyte/common/sb_tbprof.c:449:14: sparse:     expected void const [noderef] __user *p
   arch/mips/sibyte/common/sb_tbprof.c:449:14: sparse:     got char *buf
   arch/mips/sibyte/common/sb_tbprof.c:464:38: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void [noderef] __user *to @@     got char *dest @@
   arch/mips/sibyte/common/sb_tbprof.c:464:38: sparse:     expected void [noderef] __user *to
   arch/mips/sibyte/common/sb_tbprof.c:464:38: sparse:     got char *dest
>> arch/mips/sibyte/common/sb_tbprof.c:515:23: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected int [noderef] __user *__p @@     got int * @@
   arch/mips/sibyte/common/sb_tbprof.c:515:23: sparse:     expected int [noderef] __user *__p
   arch/mips/sibyte/common/sb_tbprof.c:515:23: sparse:     got int *
   arch/mips/sibyte/common/sb_tbprof.c:531:27: sparse: sparse: incorrect type in initializer (incompatible argument 2 (different address spaces)) @@     expected int ( *read )( ... ) @@     got int ( * )( ... ) @@
   arch/mips/sibyte/common/sb_tbprof.c:531:27: sparse:     expected int ( *read )( ... )
   arch/mips/sibyte/common/sb_tbprof.c:531:27: sparse:     got int ( * )( ... )
--
   command-line: note: in included file:
   builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_ACQUIRE redefined
   builtin:0:0: sparse: this was the original definition
   builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_SEQ_CST redefined
   builtin:0:0: sparse: this was the original definition
   builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_ACQ_REL redefined
   builtin:0:0: sparse: this was the original definition
   builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_RELEASE redefined
   builtin:0:0: sparse: this was the original definition
   kernel/ptrace.c:53:22: sparse: sparse: incompatible types in comparison expression (different address spaces):
   kernel/ptrace.c:53:22: sparse:    struct task_struct *
   kernel/ptrace.c:53:22: sparse:    struct task_struct [noderef] __rcu *
   kernel/ptrace.c:72:23: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected struct task_struct [noderef] __rcu *parent @@     got struct task_struct *new_parent @@
   kernel/ptrace.c:72:23: sparse:     expected struct task_struct [noderef] __rcu *parent
   kernel/ptrace.c:72:23: sparse:     got struct task_struct *new_parent
   kernel/ptrace.c:73:29: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected struct cred const [noderef] __rcu *ptracer_cred @@     got struct cred const * @@
   kernel/ptrace.c:73:29: sparse:     expected struct cred const [noderef] __rcu *ptracer_cred
   kernel/ptrace.c:73:29: sparse:     got struct cred const *
   kernel/ptrace.c:127:18: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected struct cred const *old_cred @@     got struct cred const [noderef] __rcu *ptracer_cred @@
   kernel/ptrace.c:127:18: sparse:     expected struct cred const *old_cred
   kernel/ptrace.c:127:18: sparse:     got struct cred const [noderef] __rcu *ptracer_cred
   kernel/ptrace.c:131:25: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct spinlock [usertype] *lock @@     got struct spinlock [noderef] __rcu * @@
   kernel/ptrace.c:131:25: sparse:     expected struct spinlock [usertype] *lock
   kernel/ptrace.c:131:25: sparse:     got struct spinlock [noderef] __rcu *
   kernel/ptrace.c:169:27: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct spinlock [usertype] *lock @@     got struct spinlock [noderef] __rcu * @@
   kernel/ptrace.c:169:27: sparse:     expected struct spinlock [usertype] *lock
   kernel/ptrace.c:169:27: sparse:     got struct spinlock [noderef] __rcu *
   kernel/ptrace.c:181:28: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct spinlock [usertype] *lock @@     got struct spinlock [noderef] __rcu * @@
   kernel/ptrace.c:181:28: sparse:     expected struct spinlock [usertype] *lock
   kernel/ptrace.c:181:28: sparse:     got struct spinlock [noderef] __rcu *
   kernel/ptrace.c:186:30: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct spinlock [usertype] *lock @@     got struct spinlock [noderef] __rcu * @@
   kernel/ptrace.c:186:30: sparse:     expected struct spinlock [usertype] *lock
   kernel/ptrace.c:186:30: sparse:     got struct spinlock [noderef] __rcu *
   kernel/ptrace.c:196:9: sparse: sparse: incompatible types in comparison expression (different address spaces):
   kernel/ptrace.c:196:9: sparse:    struct task_struct [noderef] __rcu *
   kernel/ptrace.c:196:9: sparse:    struct task_struct *
   kernel/ptrace.c:241:44: sparse: sparse: incompatible types in comparison expression (different address spaces):
   kernel/ptrace.c:241:44: sparse:    struct task_struct [noderef] __rcu *
   kernel/ptrace.c:241:44: sparse:    struct task_struct *
   kernel/ptrace.c:415:24: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct spinlock [usertype] *lock @@     got struct spinlock [noderef] __rcu * @@
   kernel/ptrace.c:415:24: sparse:     expected struct spinlock [usertype] *lock
   kernel/ptrace.c:415:24: sparse:     got struct spinlock [noderef] __rcu *
   kernel/ptrace.c:438:26: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct spinlock [usertype] *lock @@     got struct spinlock [noderef] __rcu * @@
   kernel/ptrace.c:438:26: sparse:     expected struct spinlock [usertype] *lock
   kernel/ptrace.c:438:26: sparse:     got struct spinlock [noderef] __rcu *
   kernel/ptrace.c:474:54: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct task_struct *parent @@     got struct task_struct [noderef] __rcu *parent @@
   kernel/ptrace.c:474:54: sparse:     expected struct task_struct *parent
   kernel/ptrace.c:474:54: sparse:     got struct task_struct [noderef] __rcu *parent
   kernel/ptrace.c:482:53: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected struct task_struct *new_parent @@     got struct task_struct [noderef] __rcu *real_parent @@
   kernel/ptrace.c:482:53: sparse:     expected struct task_struct *new_parent
   kernel/ptrace.c:482:53: sparse:     got struct task_struct [noderef] __rcu *real_parent
   kernel/ptrace.c:530:41: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct task_struct *p1 @@     got struct task_struct [noderef] __rcu *real_parent @@
   kernel/ptrace.c:530:41: sparse:     expected struct task_struct *p1
   kernel/ptrace.c:530:41: sparse:     got struct task_struct [noderef] __rcu *real_parent
   kernel/ptrace.c:532:50: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct sighand_struct *sigh @@     got struct sighand_struct [noderef] __rcu *sighand @@
   kernel/ptrace.c:532:50: sparse:     expected struct sighand_struct *sigh
   kernel/ptrace.c:532:50: sparse:     got struct sighand_struct [noderef] __rcu *sighand
   kernel/ptrace.c:734:37: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct spinlock [usertype] *lock @@     got struct spinlock [noderef] __rcu * @@
   kernel/ptrace.c:734:37: sparse:     expected struct spinlock [usertype] *lock
   kernel/ptrace.c:734:37: sparse:     got struct spinlock [noderef] __rcu *
   kernel/ptrace.c:742:39: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct spinlock [usertype] *lock @@     got struct spinlock [noderef] __rcu * @@
   kernel/ptrace.c:742:39: sparse:     expected struct spinlock [usertype] *lock
   kernel/ptrace.c:742:39: sparse:     got struct spinlock [noderef] __rcu *
   kernel/ptrace.c:847:37: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct spinlock [usertype] *lock @@     got struct spinlock [noderef] __rcu * @@
   kernel/ptrace.c:847:37: sparse:     expected struct spinlock [usertype] *lock
   kernel/ptrace.c:847:37: sparse:     got struct spinlock [noderef] __rcu *
   kernel/ptrace.c:851:39: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct spinlock [usertype] *lock @@     got struct spinlock [noderef] __rcu * @@
   kernel/ptrace.c:851:39: sparse:     expected struct spinlock [usertype] *lock
   kernel/ptrace.c:851:39: sparse:     got struct spinlock [noderef] __rcu *
   kernel/ptrace.c:1081:37: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct spinlock [usertype] *lock @@     got struct spinlock [noderef] __rcu * @@
   kernel/ptrace.c:1081:37: sparse:     expected struct spinlock [usertype] *lock
   kernel/ptrace.c:1081:37: sparse:     got struct spinlock [noderef] __rcu *
   kernel/ptrace.c:1083:39: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct spinlock [usertype] *lock @@     got struct spinlock [noderef] __rcu * @@
   kernel/ptrace.c:1083:39: sparse:     expected struct spinlock [usertype] *lock
   kernel/ptrace.c:1083:39: sparse:     got struct spinlock [noderef] __rcu *
   kernel/ptrace.c:480:38: sparse: sparse: dereference of noderef expression
   kernel/ptrace.c: note: in included file (through include/linux/rcuwait.h, include/linux/percpu-rwsem.h, include/linux/fs.h, ...):
   include/linux/sched/signal.h:708:37: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct spinlock [usertype] *lock @@     got struct spinlock [noderef] __rcu * @@
   include/linux/sched/signal.h:708:37: sparse:     expected struct spinlock [usertype] *lock
   include/linux/sched/signal.h:708:37: sparse:     got struct spinlock [noderef] __rcu *
   kernel/ptrace.c:681:9: sparse: sparse: context imbalance in 'ptrace_getsiginfo' - different lock contexts for basic block
   include/linux/sched/signal.h:708:37: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct spinlock [usertype] *lock @@     got struct spinlock [noderef] __rcu * @@
   include/linux/sched/signal.h:708:37: sparse:     expected struct spinlock [usertype] *lock
   include/linux/sched/signal.h:708:37: sparse:     got struct spinlock [noderef] __rcu *
   kernel/ptrace.c:697:9: sparse: sparse: context imbalance in 'ptrace_setsiginfo' - different lock contexts for basic block
   kernel/ptrace.c:853:9: sparse: sparse: context imbalance in 'ptrace_resume' - different lock contexts for basic block
   kernel/ptrace.c: note: in included file:
>> arch/mips/include/asm/syscall.h:70:17: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected int const [noderef] __user *__p @@     got int * @@
   arch/mips/include/asm/syscall.h:70:17: sparse:     expected int const [noderef] __user *__p
   arch/mips/include/asm/syscall.h:70:17: sparse:     got int *
   kernel/ptrace.c: note: in included file (through include/linux/rcuwait.h, include/linux/percpu-rwsem.h, include/linux/fs.h, ...):
   include/linux/sched/signal.h:708:37: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct spinlock [usertype] *lock @@     got struct spinlock [noderef] __rcu * @@
   include/linux/sched/signal.h:708:37: sparse:     expected struct spinlock [usertype] *lock
   include/linux/sched/signal.h:708:37: sparse:     got struct spinlock [noderef] __rcu *
   include/linux/sched/signal.h:708:37: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct spinlock [usertype] *lock @@     got struct spinlock [noderef] __rcu * @@
   include/linux/sched/signal.h:708:37: sparse:     expected struct spinlock [usertype] *lock
   include/linux/sched/signal.h:708:37: sparse:     got struct spinlock [noderef] __rcu *
   kernel/ptrace.c:1229:9: sparse: sparse: context imbalance in 'ptrace_request' - different lock contexts for basic block
--
   command-line: note: in included file:
   builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_ACQUIRE redefined
   builtin:0:0: sparse: this was the original definition
   builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_SEQ_CST redefined
   builtin:0:0: sparse: this was the original definition
   builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_ACQ_REL redefined
   builtin:0:0: sparse: this was the original definition
   builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_RELEASE redefined
   builtin:0:0: sparse: this was the original definition
   kernel/seccomp.c:1333:31: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct spinlock [usertype] *lock @@     got struct spinlock [noderef] __rcu * @@
   kernel/seccomp.c:1333:31: sparse:     expected struct spinlock [usertype] *lock
   kernel/seccomp.c:1333:31: sparse:     got struct spinlock [noderef] __rcu *
   kernel/seccomp.c:1345:33: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct spinlock [usertype] *lock @@     got struct spinlock [noderef] __rcu * @@
   kernel/seccomp.c:1345:33: sparse:     expected struct spinlock [usertype] *lock
   kernel/seccomp.c:1345:33: sparse:     got struct spinlock [noderef] __rcu *
   kernel/seccomp.c:1831:31: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct spinlock [usertype] *lock @@     got struct spinlock [noderef] __rcu * @@
   kernel/seccomp.c:1831:31: sparse:     expected struct spinlock [usertype] *lock
   kernel/seccomp.c:1831:31: sparse:     got struct spinlock [noderef] __rcu *
   kernel/seccomp.c:1849:33: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct spinlock [usertype] *lock @@     got struct spinlock [noderef] __rcu * @@
   kernel/seccomp.c:1849:33: sparse:     expected struct spinlock [usertype] *lock
   kernel/seccomp.c:1849:33: sparse:     got struct spinlock [noderef] __rcu *
   kernel/seccomp.c: note: in included file:
>> arch/mips/include/asm/syscall.h:70:17: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected int const [noderef] __user *__p @@     got int * @@
   arch/mips/include/asm/syscall.h:70:17: sparse:     expected int const [noderef] __user *__p
   arch/mips/include/asm/syscall.h:70:17: sparse:     got int *
--
   command-line: note: in included file:
   builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_ACQUIRE redefined
   builtin:0:0: sparse: this was the original definition
   builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_SEQ_CST redefined
   builtin:0:0: sparse: this was the original definition
   builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_ACQ_REL redefined
   builtin:0:0: sparse: this was the original definition
   builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_RELEASE redefined
   builtin:0:0: sparse: this was the original definition
>> drivers/w1/slaves/w1_ds28e04.c:342:13: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected char [noderef] __user *__p @@     got char *buf @@
   drivers/w1/slaves/w1_ds28e04.c:342:13: sparse:     expected char [noderef] __user *__p
   drivers/w1/slaves/w1_ds28e04.c:342:13: sparse:     got char *buf
>> drivers/w1/slaves/w1_ds28e04.c:356:13: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected char const [noderef] __user *__p @@     got char const *buf @@
   drivers/w1/slaves/w1_ds28e04.c:356:13: sparse:     expected char const [noderef] __user *__p
   drivers/w1/slaves/w1_ds28e04.c:356:13: sparse:     got char const *buf

vim +173 arch/mips/kernel/syscall.c

3c37026d43c47b Ralf Baechle        2005-04-13   96  
12890d0f61fc4e Ralf Baechle        2012-12-27   97  static inline int mips_atomic_set(unsigned long addr, unsigned long new)
^1da177e4c3f41 Linus Torvalds      2005-04-16   98  {
f1e39a4a616cd9 Ralf Baechle        2009-09-17   99  	unsigned long old, tmp;
12890d0f61fc4e Ralf Baechle        2012-12-27  100  	struct pt_regs *regs;
f1e39a4a616cd9 Ralf Baechle        2009-09-17  101  	unsigned int err;
f1e39a4a616cd9 Ralf Baechle        2009-09-17  102  
f1e39a4a616cd9 Ralf Baechle        2009-09-17  103  	if (unlikely(addr & 3))
f1e39a4a616cd9 Ralf Baechle        2009-09-17  104  		return -EINVAL;
f1e39a4a616cd9 Ralf Baechle        2009-09-17  105  
96d4f267e40f95 Linus Torvalds      2019-01-03  106  	if (unlikely(!access_ok((const void __user *)addr, 4)))
f1e39a4a616cd9 Ralf Baechle        2009-09-17  107  		return -EINVAL;
f1e39a4a616cd9 Ralf Baechle        2009-09-17  108  
256ec489f1c772 Thomas Bogendoerfer 2020-08-24  109  	if (cpu_has_llsc && IS_ENABLED(CONFIG_WAR_R10000_LLSC)) {
f1e39a4a616cd9 Ralf Baechle        2009-09-17  110  		__asm__ __volatile__ (
378ed6f0e3c525 Paul Burton         2018-11-08  111  		"	.set	push					\n"
a809d46066d517 Ralf Baechle        2014-03-30  112  		"	.set	arch=r4000				\n"
f1e39a4a616cd9 Ralf Baechle        2009-09-17  113  		"	li	%[err], 0				\n"
f1e39a4a616cd9 Ralf Baechle        2009-09-17  114  		"1:	ll	%[old], (%[addr])			\n"
f1e39a4a616cd9 Ralf Baechle        2009-09-17  115  		"	move	%[tmp], %[new]				\n"
f1e39a4a616cd9 Ralf Baechle        2009-09-17  116  		"2:	sc	%[tmp], (%[addr])			\n"
f1e39a4a616cd9 Ralf Baechle        2009-09-17  117  		"	beqzl	%[tmp], 1b				\n"
f1e39a4a616cd9 Ralf Baechle        2009-09-17  118  		"3:							\n"
0e525e48f73cc8 Maciej W. Rozycki   2014-11-15  119  		"	.insn						\n"
f1e39a4a616cd9 Ralf Baechle        2009-09-17  120  		"	.section .fixup,\"ax\"				\n"
f1e39a4a616cd9 Ralf Baechle        2009-09-17  121  		"4:	li	%[err], %[efault]			\n"
f1e39a4a616cd9 Ralf Baechle        2009-09-17  122  		"	j	3b					\n"
f1e39a4a616cd9 Ralf Baechle        2009-09-17  123  		"	.previous					\n"
f1e39a4a616cd9 Ralf Baechle        2009-09-17  124  		"	.section __ex_table,\"a\"			\n"
f1e39a4a616cd9 Ralf Baechle        2009-09-17  125  		"	"STR(PTR)"	1b, 4b				\n"
f1e39a4a616cd9 Ralf Baechle        2009-09-17  126  		"	"STR(PTR)"	2b, 4b				\n"
f1e39a4a616cd9 Ralf Baechle        2009-09-17  127  		"	.previous					\n"
378ed6f0e3c525 Paul Burton         2018-11-08  128  		"	.set	pop					\n"
f1e39a4a616cd9 Ralf Baechle        2009-09-17  129  		: [old] "=&r" (old),
f1e39a4a616cd9 Ralf Baechle        2009-09-17  130  		  [err] "=&r" (err),
f1e39a4a616cd9 Ralf Baechle        2009-09-17  131  		  [tmp] "=&r" (tmp)
f1e39a4a616cd9 Ralf Baechle        2009-09-17  132  		: [addr] "r" (addr),
f1e39a4a616cd9 Ralf Baechle        2009-09-17  133  		  [new] "r" (new),
f1e39a4a616cd9 Ralf Baechle        2009-09-17  134  		  [efault] "i" (-EFAULT)
f1e39a4a616cd9 Ralf Baechle        2009-09-17  135  		: "memory");
f1e39a4a616cd9 Ralf Baechle        2009-09-17  136  	} else if (cpu_has_llsc) {
f1e39a4a616cd9 Ralf Baechle        2009-09-17  137  		__asm__ __volatile__ (
378ed6f0e3c525 Paul Burton         2018-11-08  138  		"	.set	push					\n"
fee313d4b880d4 Markos Chandras     2015-01-15  139  		"	.set	"MIPS_ISA_ARCH_LEVEL"			\n"
f1e39a4a616cd9 Ralf Baechle        2009-09-17  140  		"	li	%[err], 0				\n"
4915e1b043d628 James Hogan         2017-05-31  141  		"1:							\n"
e84957e6ae043b Paul Burton         2019-10-01  142  		"	" __SYNC(full, loongson3_war) "			\n"
4915e1b043d628 James Hogan         2017-05-31  143  		user_ll("%[old]", "(%[addr])")
f1e39a4a616cd9 Ralf Baechle        2009-09-17  144  		"	move	%[tmp], %[new]				\n"
4915e1b043d628 James Hogan         2017-05-31  145  		"2:							\n"
4915e1b043d628 James Hogan         2017-05-31  146  		user_sc("%[tmp]", "(%[addr])")
203e090ade7357 James Hogan         2017-05-31  147  		"	beqz	%[tmp], 1b				\n"
f1e39a4a616cd9 Ralf Baechle        2009-09-17  148  		"3:							\n"
0e525e48f73cc8 Maciej W. Rozycki   2014-11-15  149  		"	.insn						\n"
f1e39a4a616cd9 Ralf Baechle        2009-09-17  150  		"	.section .fixup,\"ax\"				\n"
f1e39a4a616cd9 Ralf Baechle        2009-09-17  151  		"5:	li	%[err], %[efault]			\n"
f1e39a4a616cd9 Ralf Baechle        2009-09-17  152  		"	j	3b					\n"
f1e39a4a616cd9 Ralf Baechle        2009-09-17  153  		"	.previous					\n"
f1e39a4a616cd9 Ralf Baechle        2009-09-17  154  		"	.section __ex_table,\"a\"			\n"
f1e39a4a616cd9 Ralf Baechle        2009-09-17  155  		"	"STR(PTR)"	1b, 5b				\n"
f1e39a4a616cd9 Ralf Baechle        2009-09-17  156  		"	"STR(PTR)"	2b, 5b				\n"
f1e39a4a616cd9 Ralf Baechle        2009-09-17  157  		"	.previous					\n"
378ed6f0e3c525 Paul Burton         2018-11-08  158  		"	.set	pop					\n"
f1e39a4a616cd9 Ralf Baechle        2009-09-17  159  		: [old] "=&r" (old),
f1e39a4a616cd9 Ralf Baechle        2009-09-17  160  		  [err] "=&r" (err),
f1e39a4a616cd9 Ralf Baechle        2009-09-17  161  		  [tmp] "=&r" (tmp)
f1e39a4a616cd9 Ralf Baechle        2009-09-17  162  		: [addr] "r" (addr),
f1e39a4a616cd9 Ralf Baechle        2009-09-17  163  		  [new] "r" (new),
f1e39a4a616cd9 Ralf Baechle        2009-09-17  164  		  [efault] "i" (-EFAULT)
f1e39a4a616cd9 Ralf Baechle        2009-09-17  165  		: "memory");
f1e39a4a616cd9 Ralf Baechle        2009-09-17  166  	} else {
f1e39a4a616cd9 Ralf Baechle        2009-09-17  167  		do {
f1e39a4a616cd9 Ralf Baechle        2009-09-17  168  			preempt_disable();
f1e39a4a616cd9 Ralf Baechle        2009-09-17  169  			ll_bit = 1;
f1e39a4a616cd9 Ralf Baechle        2009-09-17  170  			ll_task = current;
f1e39a4a616cd9 Ralf Baechle        2009-09-17  171  			preempt_enable();
f1e39a4a616cd9 Ralf Baechle        2009-09-17  172  
f1e39a4a616cd9 Ralf Baechle        2009-09-17 @173  			err = __get_user(old, (unsigned int *) addr);
f1e39a4a616cd9 Ralf Baechle        2009-09-17 @174  			err |= __put_user(new, (unsigned int *) addr);
f1e39a4a616cd9 Ralf Baechle        2009-09-17  175  			if (err)
f1e39a4a616cd9 Ralf Baechle        2009-09-17  176  				break;
f1e39a4a616cd9 Ralf Baechle        2009-09-17  177  			rmb();
f1e39a4a616cd9 Ralf Baechle        2009-09-17  178  		} while (!ll_bit);
f1e39a4a616cd9 Ralf Baechle        2009-09-17  179  	}
f1e39a4a616cd9 Ralf Baechle        2009-09-17  180  
f1e39a4a616cd9 Ralf Baechle        2009-09-17  181  	if (unlikely(err))
f1e39a4a616cd9 Ralf Baechle        2009-09-17  182  		return err;
f1e39a4a616cd9 Ralf Baechle        2009-09-17  183  
12890d0f61fc4e Ralf Baechle        2012-12-27  184  	regs = current_pt_regs();
f1e39a4a616cd9 Ralf Baechle        2009-09-17  185  	regs->regs[2] = old;
f1e39a4a616cd9 Ralf Baechle        2009-09-17  186  	regs->regs[7] = 0;	/* No error */
f1e39a4a616cd9 Ralf Baechle        2009-09-17  187  
f1e39a4a616cd9 Ralf Baechle        2009-09-17  188  	/*
f1e39a4a616cd9 Ralf Baechle        2009-09-17  189  	 * Don't let your children do this ...
f1e39a4a616cd9 Ralf Baechle        2009-09-17  190  	 */
f1e39a4a616cd9 Ralf Baechle        2009-09-17  191  	__asm__ __volatile__(
f1e39a4a616cd9 Ralf Baechle        2009-09-17  192  	"	move	$29, %0						\n"
f1e39a4a616cd9 Ralf Baechle        2009-09-17  193  	"	j	syscall_exit					\n"
f1e39a4a616cd9 Ralf Baechle        2009-09-17  194  	: /* no outputs */
f1e39a4a616cd9 Ralf Baechle        2009-09-17  195  	: "r" (regs));
f1e39a4a616cd9 Ralf Baechle        2009-09-17  196  
f1e39a4a616cd9 Ralf Baechle        2009-09-17  197  	/* unreached.  Honestly.  */
f2ace93136cade Ralf Baechle        2012-12-27  198  	unreachable();
f1e39a4a616cd9 Ralf Baechle        2009-09-17  199  }
f1e39a4a616cd9 Ralf Baechle        2009-09-17  200  

:::::: The code at line 173 was first introduced by commit
:::::: f1e39a4a616cd9981a9decfd5332fd07a01abb8b MIPS: Rewrite sysmips(MIPS_ATOMIC_SET, ...) in C with inline assembler

:::::: TO: Ralf Baechle <ralf@...ux-mips.org>
:::::: CC: Ralf Baechle <ralf@...ux-mips.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" (37044 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ