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: <202210202106.rYDuFyP2-lkp@intel.com>
Date:   Thu, 20 Oct 2022 21:22:38 +0800
From:   kernel test robot <lkp@...el.com>
To:     "Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>
Cc:     kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org
Subject: [kas:lam 5/18] kernel/signal.c:1268:29: sparse: sparse: incorrect
 type in assignment (different address spaces)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/kas/linux.git lam
head:   01819ca3dcb30fc9114025c8c5da8bcee0cabcee
commit: bb9d0488e7c6bfff85581168d4f49f48cd11ac36 [5/18] x86/uaccess: Provide untagged_addr() and remove tags before address check
config: i386-randconfig-s001
compiler: gcc-11 (Debian 11.3.0-8) 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/kas/linux.git/commit/?id=bb9d0488e7c6bfff85581168d4f49f48cd11ac36
        git remote add kas https://git.kernel.org/pub/scm/linux/kernel/git/kas/linux.git
        git fetch --no-tags kas lam
        git checkout bb9d0488e7c6bfff85581168d4f49f48cd11ac36
        # 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

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@...el.com>

sparse warnings: (new ones prefixed by >>)
   kernel/signal.c: note: in included file (through arch/x86/include/uapi/asm/signal.h, arch/x86/include/asm/signal.h, include/uapi/linux/signal.h, ...):
   include/uapi/asm-generic/signal-defs.h:83:29: sparse: sparse: multiple address spaces given
   kernel/signal.c:195:31: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct spinlock [usertype] *lock @@     got struct spinlock [noderef] __rcu * @@
   kernel/signal.c:195:31: sparse:     expected struct spinlock [usertype] *lock
   kernel/signal.c:195:31: sparse:     got struct spinlock [noderef] __rcu *
   kernel/signal.c:198:33: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct spinlock [usertype] *lock @@     got struct spinlock [noderef] __rcu * @@
   kernel/signal.c:198:33: sparse:     expected struct spinlock [usertype] *lock
   kernel/signal.c:198:33: sparse:     got struct spinlock [noderef] __rcu *
   kernel/signal.c:480:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct spinlock [usertype] *lock @@     got struct spinlock [noderef] __rcu * @@
   kernel/signal.c:480:9: sparse:     expected struct spinlock [usertype] *lock
   kernel/signal.c:480:9: sparse:     got struct spinlock [noderef] __rcu *
   kernel/signal.c:484:34: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct spinlock [usertype] *lock @@     got struct spinlock [noderef] __rcu * @@
   kernel/signal.c:484:34: sparse:     expected struct spinlock [usertype] *lock
   kernel/signal.c:484:34: sparse:     got struct spinlock [noderef] __rcu *
   kernel/signal.c:517:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct spinlock [usertype] *lock @@     got struct spinlock [noderef] __rcu * @@
   kernel/signal.c:517:9: sparse:     expected struct spinlock [usertype] *lock
   kernel/signal.c:517:9: sparse:     got struct spinlock [noderef] __rcu *
   kernel/signal.c:520:36: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct spinlock [usertype] *lock @@     got struct spinlock [noderef] __rcu * @@
   kernel/signal.c:520:36: sparse:     expected struct spinlock [usertype] *lock
   kernel/signal.c:520:36: sparse:     got struct spinlock [noderef] __rcu *
   kernel/signal.c:542:53: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected struct k_sigaction *ka @@     got struct k_sigaction [noderef] __rcu * @@
   kernel/signal.c:542:53: sparse:     expected struct k_sigaction *ka
   kernel/signal.c:542:53: sparse:     got struct k_sigaction [noderef] __rcu *
   include/uapi/asm-generic/signal-defs.h:83:29: sparse: sparse: multiple address spaces given
   kernel/signal.c:698:33: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct spinlock [usertype] *lock @@     got struct spinlock [noderef] __rcu * @@
   kernel/signal.c:698:33: sparse:     expected struct spinlock [usertype] *lock
   kernel/signal.c:698:33: sparse:     got struct spinlock [noderef] __rcu *
   kernel/signal.c:700:31: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct spinlock [usertype] *lock @@     got struct spinlock [noderef] __rcu * @@
   kernel/signal.c:700:31: sparse:     expected struct spinlock [usertype] *lock
   kernel/signal.c:700:31: sparse:     got struct spinlock [noderef] __rcu *
   kernel/signal.c:765:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct lockdep_map const *lock @@     got struct lockdep_map [noderef] __rcu * @@
   kernel/signal.c:765:9: sparse:     expected struct lockdep_map const *lock
   kernel/signal.c:765:9: sparse:     got struct lockdep_map [noderef] __rcu *
   kernel/signal.c:890:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct lockdep_map const *lock @@     got struct lockdep_map [noderef] __rcu * @@
   kernel/signal.c:890:9: sparse:     expected struct lockdep_map const *lock
   kernel/signal.c:890:9: sparse:     got struct lockdep_map [noderef] __rcu *
   kernel/signal.c:1087:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct lockdep_map const *lock @@     got struct lockdep_map [noderef] __rcu * @@
   kernel/signal.c:1087:9: sparse:     expected struct lockdep_map const *lock
   kernel/signal.c:1087:9: sparse:     got struct lockdep_map [noderef] __rcu *
>> kernel/signal.c:1268:29: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected unsigned char [noderef] __user *__ptr_clean @@     got unsigned char * @@
   kernel/signal.c:1268:29: sparse:     expected unsigned char [noderef] __user *__ptr_clean
   kernel/signal.c:1268:29: sparse:     got unsigned char *
   kernel/signal.c:1329:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct spinlock [usertype] *lock @@     got struct spinlock [noderef] __rcu * @@
   kernel/signal.c:1329:9: sparse:     expected struct spinlock [usertype] *lock
   kernel/signal.c:1329:9: sparse:     got struct spinlock [noderef] __rcu *
   kernel/signal.c:1330:16: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected struct k_sigaction *action @@     got struct k_sigaction [noderef] __rcu * @@
   kernel/signal.c:1330:16: sparse:     expected struct k_sigaction *action
   kernel/signal.c:1330:16: sparse:     got struct k_sigaction [noderef] __rcu *
   kernel/signal.c:1350:34: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct spinlock [usertype] *lock @@     got struct spinlock [noderef] __rcu * @@
   kernel/signal.c:1350:34: sparse:     expected struct spinlock [usertype] *lock
   kernel/signal.c:1350:34: sparse:     got struct spinlock [noderef] __rcu *
   kernel/signal.c:1939:36: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected struct spinlock [usertype] *lock @@     got struct spinlock [noderef] __rcu * @@
   kernel/signal.c:1939:36: sparse:     expected struct spinlock [usertype] *lock
   kernel/signal.c:1939:36: sparse:     got struct spinlock [noderef] __rcu *
   kernel/signal.c:2049:44: sparse: sparse: cast removes address space '__rcu' of expression
   kernel/signal.c:2068:65: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct task_struct *tsk @@     got struct task_struct [noderef] __rcu *parent @@
   kernel/signal.c:2068:65: sparse:     expected struct task_struct *tsk
   kernel/signal.c:2068:65: sparse:     got struct task_struct [noderef] __rcu *parent
   kernel/signal.c:2069:40: sparse: sparse: cast removes address space '__rcu' of expression
   kernel/signal.c:2087:14: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected struct sighand_struct *psig @@     got struct sighand_struct [noderef] __rcu *[noderef] __rcu sighand @@
   kernel/signal.c:2087:14: sparse:     expected struct sighand_struct *psig
   kernel/signal.c:2087:14: sparse:     got struct sighand_struct [noderef] __rcu *[noderef] __rcu sighand
   kernel/signal.c:2116:53: sparse: sparse: incorrect type in argument 3 (different address spaces) @@     expected struct task_struct *t @@     got struct task_struct [noderef] __rcu *parent @@
   kernel/signal.c:2116:53: sparse:     expected struct task_struct *t
   kernel/signal.c:2116:53: sparse:     got struct task_struct [noderef] __rcu *parent
   kernel/signal.c:2117:34: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected struct task_struct *parent @@     got struct task_struct [noderef] __rcu *parent @@
   kernel/signal.c:2117:34: sparse:     expected struct task_struct *parent
   kernel/signal.c:2117:34: sparse:     got struct task_struct [noderef] __rcu *parent
   kernel/signal.c:2146:24: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected struct task_struct *parent @@     got struct task_struct [noderef] __rcu *parent @@
   kernel/signal.c:2146:24: sparse:     expected struct task_struct *parent
   kernel/signal.c:2146:24: sparse:     got struct task_struct [noderef] __rcu *parent
   kernel/signal.c:2149:24: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected struct task_struct *parent @@     got struct task_struct [noderef] __rcu *real_parent @@
   kernel/signal.c:2149:24: sparse:     expected struct task_struct *parent
   kernel/signal.c:2149:24: sparse:     got struct task_struct [noderef] __rcu *real_parent
   kernel/signal.c:2182:17: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected struct sighand_struct *sighand @@     got struct sighand_struct [noderef] __rcu *sighand @@
   kernel/signal.c:2182:17: sparse:     expected struct sighand_struct *sighand
   kernel/signal.c:2182:17: sparse:     got struct sighand_struct [noderef] __rcu *sighand
   kernel/signal.c:2222:41: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct spinlock [usertype] *lock @@     got struct spinlock [noderef] __rcu * @@
   kernel/signal.c:2222:41: sparse:     expected struct spinlock [usertype] *lock
   kernel/signal.c:2222:41: sparse:     got struct spinlock [noderef] __rcu *
   kernel/signal.c:2224:39: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct spinlock [usertype] *lock @@     got struct spinlock [noderef] __rcu * @@
   kernel/signal.c:2224:39: sparse:     expected struct spinlock [usertype] *lock
   kernel/signal.c:2224:39: sparse:     got struct spinlock [noderef] __rcu *
   kernel/signal.c:2281:33: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct spinlock [usertype] *lock @@     got struct spinlock [noderef] __rcu * @@
   kernel/signal.c:2281:33: sparse:     expected struct spinlock [usertype] *lock
   kernel/signal.c:2281:33: sparse:     got struct spinlock [noderef] __rcu *
   kernel/signal.c:2316:31: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct spinlock [usertype] *lock @@     got struct spinlock [noderef] __rcu * @@
   kernel/signal.c:2316:31: sparse:     expected struct spinlock [usertype] *lock
   kernel/signal.c:2316:31: sparse:     got struct spinlock [noderef] __rcu *
   kernel/signal.c:2356:31: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct spinlock [usertype] *lock @@     got struct spinlock [noderef] __rcu * @@
   kernel/signal.c:2356:31: sparse:     expected struct spinlock [usertype] *lock
   kernel/signal.c:2356:31: sparse:     got struct spinlock [noderef] __rcu *
   kernel/signal.c:2358:33: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct spinlock [usertype] *lock @@     got struct spinlock [noderef] __rcu * @@
   kernel/signal.c:2358:33: sparse:     expected struct spinlock [usertype] *lock
   kernel/signal.c:2358:33: sparse:     got struct spinlock [noderef] __rcu *
   kernel/signal.c:2458:41: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct spinlock [usertype] *lock @@     got struct spinlock [noderef] __rcu * @@
   kernel/signal.c:2458:41: sparse:     expected struct spinlock [usertype] *lock
   kernel/signal.c:2458:41: sparse:     got struct spinlock [noderef] __rcu *
   kernel/signal.c:2542:41: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct spinlock [usertype] *lock @@     got struct spinlock [noderef] __rcu * @@
   kernel/signal.c:2542:41: sparse:     expected struct spinlock [usertype] *lock
   kernel/signal.c:2542:41: sparse:     got struct spinlock [noderef] __rcu *
   kernel/signal.c:2554:33: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct spinlock [usertype] *lock @@     got struct spinlock [noderef] __rcu * @@
   kernel/signal.c:2554:33: sparse:     expected struct spinlock [usertype] *lock
   kernel/signal.c:2554:33: sparse:     got struct spinlock [noderef] __rcu *
   kernel/signal.c:2589:52: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct task_struct *tsk @@     got struct task_struct [noderef] __rcu *parent @@
   kernel/signal.c:2589:52: sparse:     expected struct task_struct *tsk
   kernel/signal.c:2589:52: sparse:     got struct task_struct [noderef] __rcu *parent
   kernel/signal.c:2591:49: sparse: sparse: cast removes address space '__rcu' of expression
   kernel/signal.c:2629:49: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected struct sighand_struct *sighand @@     got struct sighand_struct [noderef] __rcu *sighand @@
   kernel/signal.c:2629:49: sparse:     expected struct sighand_struct *sighand
   kernel/signal.c:2629:49: sparse:     got struct sighand_struct [noderef] __rcu *sighand
   kernel/signal.c:2958:27: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct spinlock [usertype] *lock @@     got struct spinlock [noderef] __rcu * @@
   kernel/signal.c:2958:27: sparse:     expected struct spinlock [usertype] *lock
   kernel/signal.c:2958:27: sparse:     got struct spinlock [noderef] __rcu *
   kernel/signal.c:2978:29: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct spinlock [usertype] *lock @@     got struct spinlock [noderef] __rcu * @@
   kernel/signal.c:2978:29: sparse:     expected struct spinlock [usertype] *lock
   kernel/signal.c:2978:29: sparse:     got struct spinlock [noderef] __rcu *
   kernel/signal.c:3045:27: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct spinlock [usertype] *lock @@     got struct spinlock [noderef] __rcu * @@
   kernel/signal.c:3045:27: sparse:     expected struct spinlock [usertype] *lock
   kernel/signal.c:3045:27: sparse:     got struct spinlock [noderef] __rcu *
   kernel/signal.c:3047:29: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct spinlock [usertype] *lock @@     got struct spinlock [noderef] __rcu * @@
   kernel/signal.c:3047:29: sparse:     expected struct spinlock [usertype] *lock
   kernel/signal.c:3047:29: sparse:     got struct spinlock [noderef] __rcu *
   kernel/signal.c:3198:31: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct spinlock [usertype] *lock @@     got struct spinlock [noderef] __rcu * @@
   kernel/signal.c:3198:31: sparse:     expected struct spinlock [usertype] *lock
   kernel/signal.c:3198:31: sparse:     got struct spinlock [noderef] __rcu *
   kernel/signal.c:3201:33: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct spinlock [usertype] *lock @@     got struct spinlock [noderef] __rcu * @@
   kernel/signal.c:3201:33: sparse:     expected struct spinlock [usertype] *lock
   kernel/signal.c:3201:33: sparse:     got struct spinlock [noderef] __rcu *
   kernel/signal.c:3590:27: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct spinlock [usertype] *lock @@     got struct spinlock [noderef] __rcu * @@
   kernel/signal.c:3590:27: sparse:     expected struct spinlock [usertype] *lock
   kernel/signal.c:3590:27: sparse:     got struct spinlock [noderef] __rcu *
   kernel/signal.c:3602:37: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct spinlock [usertype] *lock @@     got struct spinlock [noderef] __rcu * @@
   kernel/signal.c:3602:37: sparse:     expected struct spinlock [usertype] *lock
   kernel/signal.c:3602:37: sparse:     got struct spinlock [noderef] __rcu *
   kernel/signal.c:3607:35: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct spinlock [usertype] *lock @@     got struct spinlock [noderef] __rcu * @@
   kernel/signal.c:3607:35: sparse:     expected struct spinlock [usertype] *lock
   kernel/signal.c:3607:35: sparse:     got struct spinlock [noderef] __rcu *
   kernel/signal.c:3612:29: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct spinlock [usertype] *lock @@     got struct spinlock [noderef] __rcu * @@
   kernel/signal.c:3612:29: sparse:     expected struct spinlock [usertype] *lock

vim +1268 kernel/signal.c

7978b567d31555 Sukadev Bhattiprolu 2009-04-02  1255  
4aaefee589f97b Al Viro             2012-11-05  1256  static void print_fatal_signal(int signr)
45807a1df9f51d Ingo Molnar         2007-07-15  1257  {
4aaefee589f97b Al Viro             2012-11-05  1258  	struct pt_regs *regs = signal_pt_regs();
747800efbe8b98 Wang Xiaoqiang      2016-05-23  1259  	pr_info("potentially unexpected fatal signal %d.\n", signr);
45807a1df9f51d Ingo Molnar         2007-07-15  1260  
ca5cd877ae699e Al Viro             2007-10-29  1261  #if defined(__i386__) && !defined(__arch_um__)
747800efbe8b98 Wang Xiaoqiang      2016-05-23  1262  	pr_info("code at %08lx: ", regs->ip);
45807a1df9f51d Ingo Molnar         2007-07-15  1263  	{
45807a1df9f51d Ingo Molnar         2007-07-15  1264  		int i;
45807a1df9f51d Ingo Molnar         2007-07-15  1265  		for (i = 0; i < 16; i++) {
45807a1df9f51d Ingo Molnar         2007-07-15  1266  			unsigned char insn;
45807a1df9f51d Ingo Molnar         2007-07-15  1267  
b45c6e76bc2c72 Andi Kleen          2010-01-08 @1268  			if (get_user(insn, (unsigned char *)(regs->ip + i)))
b45c6e76bc2c72 Andi Kleen          2010-01-08  1269  				break;
747800efbe8b98 Wang Xiaoqiang      2016-05-23  1270  			pr_cont("%02x ", insn);
45807a1df9f51d Ingo Molnar         2007-07-15  1271  		}
45807a1df9f51d Ingo Molnar         2007-07-15  1272  	}
747800efbe8b98 Wang Xiaoqiang      2016-05-23  1273  	pr_cont("\n");
45807a1df9f51d Ingo Molnar         2007-07-15  1274  #endif
3a9f84d354ce1e Ed Swierk           2009-01-26  1275  	preempt_disable();
45807a1df9f51d Ingo Molnar         2007-07-15  1276  	show_regs(regs);
3a9f84d354ce1e Ed Swierk           2009-01-26  1277  	preempt_enable();
45807a1df9f51d Ingo Molnar         2007-07-15  1278  }
45807a1df9f51d Ingo Molnar         2007-07-15  1279  

:::::: The code at line 1268 was first introduced by commit
:::::: b45c6e76bc2c72f6426c14bed64fdcbc9bf37cb0 kernel/signal.c: fix kernel information leak with print-fatal-signals=1

:::::: TO: Andi Kleen <andi@...stfloor.org>
:::::: CC: Linus Torvalds <torvalds@...ux-foundation.org>

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

View attachment "config" of type "text/plain" (150278 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ