tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master head: 47c191411b68a771261be3dc0bd6f68394cef358 commit: 6479e63f7dccc53877de7980a9e4300201b623a8 [5931/6188] instrumented.h: add KMSAN support config: i386-randconfig-s001 compiler: gcc-11 (Debian 11.3.0-5) 11.3.0 reproduce: # apt-get install sparse # sparse version: v0.6.4-39-gce1a6720-dirty # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=6479e63f7dccc53877de7980a9e4300201b623a8 git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git git fetch --no-tags linux-next master git checkout 6479e63f7dccc53877de7980a9e4300201b623a8 # save the config file mkdir build_dir && cp config build_dir/.config make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=i386 SHELL=/bin/bash arch/x86/kernel/ If you fix the issue, kindly add following tag where applicable Reported-by: kernel test robot sparse warnings: (new ones prefixed by >>) arch/x86/kernel/signal.c:360:9: sparse: sparse: cast removes address space '__user' of expression arch/x86/kernel/signal.c:360:9: sparse: sparse: cast removes address space '__user' of expression arch/x86/kernel/signal.c:360:9: sparse: sparse: cast removes address space '__user' of expression arch/x86/kernel/signal.c:360:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __user *ptr @@ got unsigned long long [usertype] * @@ arch/x86/kernel/signal.c:360:9: sparse: expected void const volatile [noderef] __user *ptr arch/x86/kernel/signal.c:360:9: sparse: got unsigned long long [usertype] * arch/x86/kernel/signal.c:360:9: sparse: sparse: cast removes address space '__user' of expression arch/x86/kernel/signal.c:360:9: sparse: sparse: cast removes address space '__user' of expression arch/x86/kernel/signal.c:360:9: sparse: sparse: cast removes address space '__user' of expression arch/x86/kernel/signal.c:360:9: sparse: sparse: cast removes address space '__user' of expression arch/x86/kernel/signal.c:360:9: sparse: sparse: cast removes address space '__user' of expression arch/x86/kernel/signal.c:360:9: sparse: sparse: cast removes address space '__user' of expression >> arch/x86/kernel/signal.c:360:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void [noderef] __user *to @@ got unsigned long long [usertype] * @@ arch/x86/kernel/signal.c:360:9: sparse: expected void [noderef] __user *to arch/x86/kernel/signal.c:360:9: sparse: got unsigned long long [usertype] * arch/x86/kernel/signal.c:420:9: sparse: sparse: cast removes address space '__user' of expression arch/x86/kernel/signal.c:420:9: sparse: sparse: cast removes address space '__user' of expression arch/x86/kernel/signal.c:420:9: sparse: sparse: cast removes address space '__user' of expression arch/x86/kernel/signal.c:420:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __user *ptr @@ got unsigned long long [usertype] * @@ arch/x86/kernel/signal.c:420:9: sparse: expected void const volatile [noderef] __user *ptr arch/x86/kernel/signal.c:420:9: sparse: got unsigned long long [usertype] * arch/x86/kernel/signal.c:420:9: sparse: sparse: cast removes address space '__user' of expression arch/x86/kernel/signal.c:420:9: sparse: sparse: cast removes address space '__user' of expression arch/x86/kernel/signal.c:420:9: sparse: sparse: cast removes address space '__user' of expression arch/x86/kernel/signal.c:420:9: sparse: sparse: cast removes address space '__user' of expression arch/x86/kernel/signal.c:420:9: sparse: sparse: cast removes address space '__user' of expression arch/x86/kernel/signal.c:420:9: sparse: sparse: cast removes address space '__user' of expression arch/x86/kernel/signal.c:420:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void [noderef] __user *to @@ got unsigned long long [usertype] * @@ arch/x86/kernel/signal.c:420:9: sparse: expected void [noderef] __user *to arch/x86/kernel/signal.c:420:9: sparse: got unsigned long long [usertype] * arch/x86/kernel/signal.c:953:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct lockdep_map const *lock @@ got struct lockdep_map [noderef] __rcu * @@ arch/x86/kernel/signal.c:953:9: sparse: expected struct lockdep_map const *lock arch/x86/kernel/signal.c:953:9: sparse: got struct lockdep_map [noderef] __rcu * vim +360 arch/x86/kernel/signal.c 75779f05264b99 arch/x86/kernel/signal.c Hiroshi Shimamoto 2009-02-27 325 7e907f48980d66 arch/x86/kernel/signal_32.c Ingo Molnar 2008-03-06 326 static int 235b80226b986d arch/x86/kernel/signal.c Al Viro 2012-11-09 327 __setup_frame(int sig, struct ksignal *ksig, sigset_t *set, 7e907f48980d66 arch/x86/kernel/signal_32.c Ingo Molnar 2008-03-06 328 struct pt_regs *regs) ^1da177e4c3f41 arch/i386/kernel/signal.c Linus Torvalds 2005-04-16 329 { ^1da177e4c3f41 arch/i386/kernel/signal.c Linus Torvalds 2005-04-16 330 struct sigframe __user *frame; 7e907f48980d66 arch/x86/kernel/signal_32.c Ingo Molnar 2008-03-06 331 void __user *restorer; b00d8f8f0b2b39 arch/x86/kernel/signal.c Al Viro 2020-02-15 332 void __user *fp = NULL; ^1da177e4c3f41 arch/i386/kernel/signal.c Linus Torvalds 2005-04-16 333 b00d8f8f0b2b39 arch/x86/kernel/signal.c Al Viro 2020-02-15 334 frame = get_sigframe(&ksig->ka, regs, sizeof(*frame), &fp); ^1da177e4c3f41 arch/i386/kernel/signal.c Linus Torvalds 2005-04-16 335 5c1f178094631e arch/x86/kernel/signal.c Al Viro 2020-02-15 336 if (!user_access_begin(frame, sizeof(*frame))) 3d0aedd9538e6b arch/x86/kernel/signal_32.c Hiroshi Shimamoto 2008-09-12 337 return -EFAULT; ^1da177e4c3f41 arch/i386/kernel/signal.c Linus Torvalds 2005-04-16 338 5c1f178094631e arch/x86/kernel/signal.c Al Viro 2020-02-15 339 unsafe_put_user(sig, &frame->sig, Efault); b00d8f8f0b2b39 arch/x86/kernel/signal.c Al Viro 2020-02-15 340 unsafe_put_sigcontext(&frame->sc, fp, regs, set, Efault); 5c1f178094631e arch/x86/kernel/signal.c Al Viro 2020-02-15 341 unsafe_put_user(set->sig[1], &frame->extramask[0], Efault); 1a3e4ca41c5a38 arch/x86/kernel/signal_32.c Roland McGrath 2008-04-09 342 if (current->mm->context.vdso) 6f121e548f8367 arch/x86/kernel/signal.c Andy Lutomirski 2014-05-05 343 restorer = current->mm->context.vdso + 0a6d1fa0d2b48f arch/x86/kernel/signal.c Andy Lutomirski 2015-10-05 344 vdso_image_32.sym___kernel_sigreturn; 9fbbd4dd17d071 arch/i386/kernel/signal.c Andi Kleen 2007-02-13 345 else ade1af77129dea arch/x86/kernel/signal_32.c Jan Engelhardt 2008-01-30 346 restorer = &frame->retcode; 235b80226b986d arch/x86/kernel/signal.c Al Viro 2012-11-09 347 if (ksig->ka.sa.sa_flags & SA_RESTORER) 235b80226b986d arch/x86/kernel/signal.c Al Viro 2012-11-09 348 restorer = ksig->ka.sa.sa_restorer; ^1da177e4c3f41 arch/i386/kernel/signal.c Linus Torvalds 2005-04-16 349 ^1da177e4c3f41 arch/i386/kernel/signal.c Linus Torvalds 2005-04-16 350 /* Set up to return from userspace. */ 5c1f178094631e arch/x86/kernel/signal.c Al Viro 2020-02-15 351 unsafe_put_user(restorer, &frame->pretcode, Efault); ^1da177e4c3f41 arch/i386/kernel/signal.c Linus Torvalds 2005-04-16 352 ^1da177e4c3f41 arch/i386/kernel/signal.c Linus Torvalds 2005-04-16 353 /* 7e907f48980d66 arch/x86/kernel/signal_32.c Ingo Molnar 2008-03-06 354 * This is popl %eax ; movl $__NR_sigreturn, %eax ; int $0x80 ^1da177e4c3f41 arch/i386/kernel/signal.c Linus Torvalds 2005-04-16 355 * ^1da177e4c3f41 arch/i386/kernel/signal.c Linus Torvalds 2005-04-16 356 * WE DO NOT USE IT ANY MORE! It's only left here for historical ^1da177e4c3f41 arch/i386/kernel/signal.c Linus Torvalds 2005-04-16 357 * reasons and because gdb uses it as a signature to notice ^1da177e4c3f41 arch/i386/kernel/signal.c Linus Torvalds 2005-04-16 358 * signal handler stack frames. ^1da177e4c3f41 arch/i386/kernel/signal.c Linus Torvalds 2005-04-16 359 */ 5c1f178094631e arch/x86/kernel/signal.c Al Viro 2020-02-15 @360 unsafe_put_user(*((u64 *)&retcode), (u64 *)frame->retcode, Efault); 5c1f178094631e arch/x86/kernel/signal.c Al Viro 2020-02-15 361 user_access_end(); ^1da177e4c3f41 arch/i386/kernel/signal.c Linus Torvalds 2005-04-16 362 ^1da177e4c3f41 arch/i386/kernel/signal.c Linus Torvalds 2005-04-16 363 /* Set up registers for signal handler */ 65ea5b03499035 arch/x86/kernel/signal_32.c H. Peter Anvin 2008-01-30 364 regs->sp = (unsigned long)frame; 235b80226b986d arch/x86/kernel/signal.c Al Viro 2012-11-09 365 regs->ip = (unsigned long)ksig->ka.sa.sa_handler; 65ea5b03499035 arch/x86/kernel/signal_32.c H. Peter Anvin 2008-01-30 366 regs->ax = (unsigned long)sig; 92bc2056855b32 arch/x86/kernel/signal_32.c Harvey Harrison 2008-02-08 367 regs->dx = 0; 92bc2056855b32 arch/x86/kernel/signal_32.c Harvey Harrison 2008-02-08 368 regs->cx = 0; ^1da177e4c3f41 arch/i386/kernel/signal.c Linus Torvalds 2005-04-16 369 65ea5b03499035 arch/x86/kernel/signal_32.c H. Peter Anvin 2008-01-30 370 regs->ds = __USER_DS; 65ea5b03499035 arch/x86/kernel/signal_32.c H. Peter Anvin 2008-01-30 371 regs->es = __USER_DS; 65ea5b03499035 arch/x86/kernel/signal_32.c H. Peter Anvin 2008-01-30 372 regs->ss = __USER_DS; 65ea5b03499035 arch/x86/kernel/signal_32.c H. Peter Anvin 2008-01-30 373 regs->cs = __USER_CS; ^1da177e4c3f41 arch/i386/kernel/signal.c Linus Torvalds 2005-04-16 374 283828f3c19ceb arch/i386/kernel/signal.c David Howells 2006-01-18 375 return 0; b00d8f8f0b2b39 arch/x86/kernel/signal.c Al Viro 2020-02-15 376 b00d8f8f0b2b39 arch/x86/kernel/signal.c Al Viro 2020-02-15 377 Efault: b00d8f8f0b2b39 arch/x86/kernel/signal.c Al Viro 2020-02-15 378 user_access_end(); b00d8f8f0b2b39 arch/x86/kernel/signal.c Al Viro 2020-02-15 379 return -EFAULT; ^1da177e4c3f41 arch/i386/kernel/signal.c Linus Torvalds 2005-04-16 380 } ^1da177e4c3f41 arch/i386/kernel/signal.c Linus Torvalds 2005-04-16 381 :::::: The code at line 360 was first introduced by commit :::::: 5c1f178094631e8b9acc67e4a9b6e03abfbc2529 x86: __setup_frame(): consolidate uaccess areas :::::: TO: Al Viro :::::: CC: Al Viro -- 0-DAY CI Kernel Test Service https://01.org/lkp