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: <202412140502.R7mSLuL5-lkp@intel.com>
Date: Sat, 14 Dec 2024 05:13:53 +0800
From: kernel test robot <lkp@...el.com>
To: Guo Ren <guoren@...ux.alibaba.com>
Cc: oe-kbuild-all@...ts.linux.dev, linux-kernel@...r.kernel.org,
	Palmer Dabbelt <palmer@...osinc.com>,
	Leonardo Bras <leobras@...hat.com>,
	Andrew Jones <ajones@...tanamicro.com>,
	Andrea Parri <parri.andrea@...il.com>
Subject: kernel/fork.c:1895:9: sparse: sparse: incorrect type in argument 1
 (different address spaces)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   243f750a2df0662bc45119f9dd5d7da031a17f36
commit: cbe82e140bb76e1aa9f808cc841654a25b70d4e5 asm-generic: ticket-lock: Reuse arch_spinlock_t of qspinlock
date:   5 weeks ago
config: riscv-randconfig-r112-20241213 (https://download.01.org/0day-ci/archive/20241214/202412140502.R7mSLuL5-lkp@intel.com/config)
compiler: riscv64-linux-gcc (GCC) 14.2.0
reproduce: (https://download.01.org/0day-ci/archive/20241214/202412140502.R7mSLuL5-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@...el.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202412140502.R7mSLuL5-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
   kernel/fork.c:1790:38: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct refcount_struct [usertype] *r @@     got struct refcount_struct [noderef] __rcu * @@
   kernel/fork.c:1790:38: sparse:     expected struct refcount_struct [usertype] *r
   kernel/fork.c:1790:38: sparse:     got struct refcount_struct [noderef] __rcu *
   kernel/fork.c:1799:31: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct spinlock [usertype] *lock @@     got struct spinlock [noderef] __rcu * @@
   kernel/fork.c:1799:31: sparse:     expected struct spinlock [usertype] *lock
   kernel/fork.c:1799:31: sparse:     got struct spinlock [noderef] __rcu *
   kernel/fork.c:1800:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const * @@     got struct k_sigaction [noderef] __rcu * @@
   kernel/fork.c:1800:9: sparse:     expected void const *
   kernel/fork.c:1800:9: sparse:     got struct k_sigaction [noderef] __rcu *
   kernel/fork.c:1800:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const * @@     got struct k_sigaction [noderef] __rcu * @@
   kernel/fork.c:1800:9: sparse:     expected void const *
   kernel/fork.c:1800:9: sparse:     got struct k_sigaction [noderef] __rcu *
   kernel/fork.c:1800:9: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void const * @@     got struct k_sigaction [noderef] __rcu * @@
   kernel/fork.c:1800:9: sparse:     expected void const *
   kernel/fork.c:1800:9: sparse:     got struct k_sigaction [noderef] __rcu *
   kernel/fork.c:1801:33: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct spinlock [usertype] *lock @@     got struct spinlock [noderef] __rcu * @@
   kernel/fork.c:1801:33: sparse:     expected struct spinlock [usertype] *lock
   kernel/fork.c:1801:33: sparse:     got struct spinlock [noderef] __rcu *
>> kernel/fork.c:1895:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct qspinlock [usertype] *lock @@     got struct qspinlock [noderef] __rcu * @@
   kernel/fork.c:1895:9: sparse:     expected struct qspinlock [usertype] *lock
   kernel/fork.c:1895:9: sparse:     got struct qspinlock [noderef] __rcu *
   kernel/fork.c:2193:31: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct spinlock [usertype] *lock @@     got struct spinlock [noderef] __rcu * @@
   kernel/fork.c:2193:31: sparse:     expected struct spinlock [usertype] *lock
   kernel/fork.c:2193:31: sparse:     got struct spinlock [noderef] __rcu *
   kernel/fork.c:2197:33: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct spinlock [usertype] *lock @@     got struct spinlock [noderef] __rcu * @@
   kernel/fork.c:2197:33: sparse:     expected struct spinlock [usertype] *lock
   kernel/fork.c:2197:33: sparse:     got struct spinlock [noderef] __rcu *
   kernel/fork.c:2511:32: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected struct task_struct [noderef] __rcu *real_parent @@     got struct task_struct * @@
   kernel/fork.c:2511:32: sparse:     expected struct task_struct [noderef] __rcu *real_parent
   kernel/fork.c:2511:32: sparse:     got struct task_struct *
   kernel/fork.c:2520:27: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct spinlock [usertype] *lock @@     got struct spinlock [noderef] __rcu * @@
   kernel/fork.c:2520:27: sparse:     expected struct spinlock [usertype] *lock
   kernel/fork.c:2520:27: sparse:     got struct spinlock [noderef] __rcu *
   kernel/fork.c:2569:54: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected struct list_head *head @@     got struct list_head [noderef] __rcu * @@
   kernel/fork.c:2569:54: sparse:     expected struct list_head *head
   kernel/fork.c:2569:54: sparse:     got struct list_head [noderef] __rcu *
   kernel/fork.c:2589:29: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct spinlock [usertype] *lock @@     got struct spinlock [noderef] __rcu * @@
   kernel/fork.c:2589:29: sparse:     expected struct spinlock [usertype] *lock
   kernel/fork.c:2589:29: sparse:     got struct spinlock [noderef] __rcu *
   kernel/fork.c:2611:29: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct spinlock [usertype] *lock @@     got struct spinlock [noderef] __rcu * @@
   kernel/fork.c:2611:29: sparse:     expected struct spinlock [usertype] *lock
   kernel/fork.c:2611:29: sparse:     got struct spinlock [noderef] __rcu *
   kernel/fork.c:2639:28: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct sighand_struct *sighand @@     got struct sighand_struct [noderef] __rcu *sighand @@
   kernel/fork.c:2639:28: sparse:     expected struct sighand_struct *sighand
   kernel/fork.c:2639:28: sparse:     got struct sighand_struct [noderef] __rcu *sighand
   kernel/fork.c:2670:31: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct spinlock [usertype] *lock @@     got struct spinlock [noderef] __rcu * @@
   kernel/fork.c:2670:31: sparse:     expected struct spinlock [usertype] *lock
   kernel/fork.c:2670:31: sparse:     got struct spinlock [noderef] __rcu *
   kernel/fork.c:2672:33: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct spinlock [usertype] *lock @@     got struct spinlock [noderef] __rcu * @@
   kernel/fork.c:2672:33: sparse:     expected struct spinlock [usertype] *lock
   kernel/fork.c:2672:33: sparse:     got struct spinlock [noderef] __rcu *
   kernel/fork.c:3115:24: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected struct task_struct *[assigned] parent @@     got struct task_struct [noderef] __rcu *real_parent @@
   kernel/fork.c:3115:24: sparse:     expected struct task_struct *[assigned] parent
   kernel/fork.c:3115:24: sparse:     got struct task_struct [noderef] __rcu *real_parent
   kernel/fork.c:3203:43: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct refcount_struct const [usertype] *r @@     got struct refcount_struct [noderef] __rcu * @@
   kernel/fork.c:3203:43: sparse:     expected struct refcount_struct const [usertype] *r
   kernel/fork.c:3203:43: sparse:     got struct refcount_struct [noderef] __rcu *
   kernel/fork.c:2243:22: sparse: sparse: dereference of noderef expression
   kernel/fork.c: note: in included file (through include/linux/ftrace.h, include/linux/perf_event.h, include/linux/trace_events.h, ...):
   include/linux/ptrace.h:210:45: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected struct task_struct *new_parent @@     got struct task_struct [noderef] __rcu *parent @@
   include/linux/ptrace.h:210:45: sparse:     expected struct task_struct *new_parent
   include/linux/ptrace.h:210:45: sparse:     got struct task_struct [noderef] __rcu *parent
   include/linux/ptrace.h:210:62: sparse: sparse: incorrect type in argument 3 (different address spaces) @@     expected struct cred const *ptracer_cred @@     got struct cred const [noderef] __rcu *ptracer_cred @@
   include/linux/ptrace.h:210:62: sparse:     expected struct cred const *ptracer_cred
   include/linux/ptrace.h:210:62: sparse:     got struct cred const [noderef] __rcu *ptracer_cred
   kernel/fork.c:2567:59: sparse: sparse: dereference of noderef expression
   kernel/fork.c:2568:59: sparse: sparse: dereference of noderef expression
--
   kernel/seccomp.c:579:27: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct spinlock [usertype] *lock @@     got struct spinlock [noderef] __rcu * @@
   kernel/seccomp.c:579:27: sparse:     expected struct spinlock [usertype] *lock
   kernel/seccomp.c:579:27: sparse:     got struct spinlock [noderef] __rcu *
   kernel/seccomp.c:583:29: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct spinlock [usertype] *lock @@     got struct spinlock [noderef] __rcu * @@
   kernel/seccomp.c:583:29: sparse:     expected struct spinlock [usertype] *lock
   kernel/seccomp.c:583:29: sparse:     got struct spinlock [noderef] __rcu *
>> kernel/seccomp.c:895:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct qspinlock [usertype] *lock @@     got struct qspinlock [noderef] __rcu * @@
   kernel/seccomp.c:895:9: sparse:     expected struct qspinlock [usertype] *lock
   kernel/seccomp.c:895:9: sparse:     got struct qspinlock [noderef] __rcu *
   kernel/seccomp.c:1396:31: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct spinlock [usertype] *lock @@     got struct spinlock [noderef] __rcu * @@
   kernel/seccomp.c:1396:31: sparse:     expected struct spinlock [usertype] *lock
   kernel/seccomp.c:1396:31: sparse:     got struct spinlock [noderef] __rcu *
   kernel/seccomp.c:1408:33: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct spinlock [usertype] *lock @@     got struct spinlock [noderef] __rcu * @@
   kernel/seccomp.c:1408:33: sparse:     expected struct spinlock [usertype] *lock
   kernel/seccomp.c:1408:33: sparse:     got struct spinlock [noderef] __rcu *
   kernel/seccomp.c:1980:31: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct spinlock [usertype] *lock @@     got struct spinlock [noderef] __rcu * @@
   kernel/seccomp.c:1980:31: sparse:     expected struct spinlock [usertype] *lock
   kernel/seccomp.c:1980:31: sparse:     got struct spinlock [noderef] __rcu *
   kernel/seccomp.c:1998:33: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct spinlock [usertype] *lock @@     got struct spinlock [noderef] __rcu * @@
   kernel/seccomp.c:1998:33: sparse:     expected struct spinlock [usertype] *lock
   kernel/seccomp.c:1998:33: sparse:     got struct spinlock [noderef] __rcu *
   kernel/seccomp.c:495:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct qspinlock [usertype] *lock @@     got struct qspinlock [noderef] __rcu * @@
   kernel/seccomp.c:495:9: sparse:     expected struct qspinlock [usertype] *lock
   kernel/seccomp.c:495:9: sparse:     got struct qspinlock [noderef] __rcu *
   kernel/seccomp.c:602:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct qspinlock [usertype] *lock @@     got struct qspinlock [noderef] __rcu * @@
   kernel/seccomp.c:602:9: sparse:     expected struct qspinlock [usertype] *lock
   kernel/seccomp.c:602:9: sparse:     got struct qspinlock [noderef] __rcu *
   kernel/seccomp.c:453:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct qspinlock [usertype] *lock @@     got struct qspinlock [noderef] __rcu * @@
   kernel/seccomp.c:453:9: sparse:     expected struct qspinlock [usertype] *lock
   kernel/seccomp.c:453:9: sparse:     got struct qspinlock [noderef] __rcu *
   kernel/seccomp.c:439:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct qspinlock [usertype] *lock @@     got struct qspinlock [noderef] __rcu * @@
   kernel/seccomp.c:439:9: sparse:     expected struct qspinlock [usertype] *lock
   kernel/seccomp.c:439:9: sparse:     got struct qspinlock [noderef] __rcu *
   kernel/seccomp.c:453:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct qspinlock [usertype] *lock @@     got struct qspinlock [noderef] __rcu * @@
   kernel/seccomp.c:453:9: sparse:     expected struct qspinlock [usertype] *lock
   kernel/seccomp.c:453:9: sparse:     got struct qspinlock [noderef] __rcu *
   kernel/seccomp.c:439:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct qspinlock [usertype] *lock @@     got struct qspinlock [noderef] __rcu * @@
   kernel/seccomp.c:439:9: sparse:     expected struct qspinlock [usertype] *lock
   kernel/seccomp.c:439:9: sparse:     got struct qspinlock [noderef] __rcu *
   kernel/seccomp.c:453:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct qspinlock [usertype] *lock @@     got struct qspinlock [noderef] __rcu * @@
   kernel/seccomp.c:453:9: sparse:     expected struct qspinlock [usertype] *lock
   kernel/seccomp.c:453:9: sparse:     got struct qspinlock [noderef] __rcu *
   kernel/seccomp.c: note: in included file (through include/linux/ptrace.h, include/linux/audit.h):
   include/linux/sched/signal.h:753: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:753:37: sparse:     expected struct spinlock [usertype] *lock
   include/linux/sched/signal.h:753:37: sparse:     got struct spinlock [noderef] __rcu *
   include/linux/sched/signal.h:753: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:753:37: sparse:     expected struct spinlock [usertype] *lock
   include/linux/sched/signal.h:753:37: sparse:     got struct spinlock [noderef] __rcu *

vim +1895 kernel/fork.c

^1da177e4c3f41 Linus Torvalds          2005-04-16  1885  
dbd952127d11bb Kees Cook               2014-06-27  1886  static void copy_seccomp(struct task_struct *p)
dbd952127d11bb Kees Cook               2014-06-27  1887  {
dbd952127d11bb Kees Cook               2014-06-27  1888  #ifdef CONFIG_SECCOMP
dbd952127d11bb Kees Cook               2014-06-27  1889  	/*
dbd952127d11bb Kees Cook               2014-06-27  1890  	 * Must be called with sighand->lock held, which is common to
dbd952127d11bb Kees Cook               2014-06-27  1891  	 * all threads in the group. Holding cred_guard_mutex is not
dbd952127d11bb Kees Cook               2014-06-27  1892  	 * needed because this new task is not yet running and cannot
dbd952127d11bb Kees Cook               2014-06-27  1893  	 * be racing exec.
dbd952127d11bb Kees Cook               2014-06-27  1894  	 */
69f6a34bdeea4f Guenter Roeck           2014-08-10 @1895  	assert_spin_locked(&current->sighand->siglock);
dbd952127d11bb Kees Cook               2014-06-27  1896  
dbd952127d11bb Kees Cook               2014-06-27  1897  	/* Ref-count the new filter user, and assign it. */
dbd952127d11bb Kees Cook               2014-06-27  1898  	get_seccomp_filter(current);
dbd952127d11bb Kees Cook               2014-06-27  1899  	p->seccomp = current->seccomp;
dbd952127d11bb Kees Cook               2014-06-27  1900  
dbd952127d11bb Kees Cook               2014-06-27  1901  	/*
dbd952127d11bb Kees Cook               2014-06-27  1902  	 * Explicitly enable no_new_privs here in case it got set
dbd952127d11bb Kees Cook               2014-06-27  1903  	 * between the task_struct being duplicated and holding the
dbd952127d11bb Kees Cook               2014-06-27  1904  	 * sighand lock. The seccomp state and nnp must be in sync.
dbd952127d11bb Kees Cook               2014-06-27  1905  	 */
dbd952127d11bb Kees Cook               2014-06-27  1906  	if (task_no_new_privs(current))
dbd952127d11bb Kees Cook               2014-06-27  1907  		task_set_no_new_privs(p);
dbd952127d11bb Kees Cook               2014-06-27  1908  
dbd952127d11bb Kees Cook               2014-06-27  1909  	/*
dbd952127d11bb Kees Cook               2014-06-27  1910  	 * If the parent gained a seccomp mode after copying thread
dbd952127d11bb Kees Cook               2014-06-27  1911  	 * flags and between before we held the sighand lock, we have
dbd952127d11bb Kees Cook               2014-06-27  1912  	 * to manually enable the seccomp thread flag here.
dbd952127d11bb Kees Cook               2014-06-27  1913  	 */
dbd952127d11bb Kees Cook               2014-06-27  1914  	if (p->seccomp.mode != SECCOMP_MODE_DISABLED)
23d67a54857a76 Gabriel Krisman Bertazi 2020-11-16  1915  		set_task_syscall_work(p, SECCOMP);
dbd952127d11bb Kees Cook               2014-06-27  1916  #endif
dbd952127d11bb Kees Cook               2014-06-27  1917  }
dbd952127d11bb Kees Cook               2014-06-27  1918  

:::::: The code at line 1895 was first introduced by commit
:::::: 69f6a34bdeea4fec50bb90619bc9602973119572 seccomp: Replace BUG(!spin_is_locked()) with assert_spin_lock

:::::: TO: Guenter Roeck <linux@...ck-us.net>
:::::: CC: Kees Cook <keescook@...omium.org>

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ