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]
Date:   Sat, 12 Nov 2022 03:14:34 +0800
From:   kernel test robot <lkp@...el.com>
To:     Qing Zhang <zhangqing@...ngson.cn>
Cc:     oe-kbuild-all@...ts.linux.dev, linux-kernel@...r.kernel.org,
        Huacai Chen <chenhuacai@...nel.org>
Subject: mm/slub.c:486:17: 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:   4bbf3422df78029f03161640dcb1e9d1ed64d1ea
commit: 93a4fa622eb061f75f87f0cf9609ab4e69c67d01 LoongArch: Add STACKTRACE support
date:   3 months ago
config: loongarch-randconfig-s052-20221111
compiler: loongarch64-linux-gcc (GCC) 12.1.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-39-gce1a6720-dirty
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=93a4fa622eb061f75f87f0cf9609ab4e69c67d01
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 93a4fa622eb061f75f87f0cf9609ab4e69c67d01
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=loongarch 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 >>)
>> mm/slub.c:486:17: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *ptr @@     got unsigned int [noderef] __percpu * @@
   mm/slub.c:486:17: sparse:     expected void *ptr
   mm/slub.c:486:17: sparse:     got unsigned int [noderef] __percpu *
>> mm/slub.c:486:17: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *ptr @@     got unsigned int [noderef] __percpu * @@
   mm/slub.c:486:17: sparse:     expected void *ptr
   mm/slub.c:486:17: sparse:     got unsigned int [noderef] __percpu *
>> mm/slub.c:486:17: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *ptr @@     got unsigned int [noderef] __percpu * @@
   mm/slub.c:486:17: sparse:     expected void *ptr
   mm/slub.c:486:17: sparse:     got unsigned int [noderef] __percpu *
>> mm/slub.c:486:17: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *ptr @@     got unsigned int [noderef] __percpu * @@
   mm/slub.c:486:17: sparse:     expected void *ptr
   mm/slub.c:486:17: sparse:     got unsigned int [noderef] __percpu *
>> mm/slub.c:486:17: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *ptr @@     got int [noderef] __percpu * @@
   mm/slub.c:486:17: sparse:     expected void *ptr
   mm/slub.c:486:17: sparse:     got int [noderef] __percpu *
>> mm/slub.c:486:17: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *ptr @@     got int [noderef] __percpu * @@
   mm/slub.c:486:17: sparse:     expected void *ptr
   mm/slub.c:486:17: sparse:     got int [noderef] __percpu *
>> mm/slub.c:486:17: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *ptr @@     got int [noderef] __percpu * @@
   mm/slub.c:486:17: sparse:     expected void *ptr
   mm/slub.c:486:17: sparse:     got int [noderef] __percpu *
>> mm/slub.c:486:17: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *ptr @@     got int [noderef] __percpu * @@
   mm/slub.c:486:17: sparse:     expected void *ptr
   mm/slub.c:486:17: sparse:     got int [noderef] __percpu *
   mm/slub.c:2475:9: sparse: sparse: context imbalance in 'deactivate_slab' - different lock contexts for basic block
>> mm/slub.c:486:17: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *ptr @@     got unsigned int [noderef] __percpu * @@
   mm/slub.c:486:17: sparse:     expected void *ptr
   mm/slub.c:486:17: sparse:     got unsigned int [noderef] __percpu *
>> mm/slub.c:486:17: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *ptr @@     got unsigned int [noderef] __percpu * @@
   mm/slub.c:486:17: sparse:     expected void *ptr
   mm/slub.c:486:17: sparse:     got unsigned int [noderef] __percpu *
>> mm/slub.c:486:17: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *ptr @@     got unsigned int [noderef] __percpu * @@
   mm/slub.c:486:17: sparse:     expected void *ptr
   mm/slub.c:486:17: sparse:     got unsigned int [noderef] __percpu *
>> mm/slub.c:486:17: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *ptr @@     got unsigned int [noderef] __percpu * @@
   mm/slub.c:486:17: sparse:     expected void *ptr
   mm/slub.c:486:17: sparse:     got unsigned int [noderef] __percpu *
>> mm/slub.c:486:17: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *ptr @@     got int [noderef] __percpu * @@
   mm/slub.c:486:17: sparse:     expected void *ptr
   mm/slub.c:486:17: sparse:     got int [noderef] __percpu *
>> mm/slub.c:486:17: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *ptr @@     got int [noderef] __percpu * @@
   mm/slub.c:486:17: sparse:     expected void *ptr
   mm/slub.c:486:17: sparse:     got int [noderef] __percpu *
>> mm/slub.c:486:17: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *ptr @@     got int [noderef] __percpu * @@
   mm/slub.c:486:17: sparse:     expected void *ptr
   mm/slub.c:486:17: sparse:     got int [noderef] __percpu *
>> mm/slub.c:486:17: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *ptr @@     got int [noderef] __percpu * @@
   mm/slub.c:486:17: sparse:     expected void *ptr
   mm/slub.c:486:17: sparse:     got int [noderef] __percpu *
   mm/slub.c:3350:47: sparse: sparse: context imbalance in '__slab_free' - unexpected unlock

vim +486 mm/slub.c

a2b4ae8bfd9c10 Vlastimil Babka   2021-06-04  474  
a2b4ae8bfd9c10 Vlastimil Babka   2021-06-04  475  /*
a2b4ae8bfd9c10 Vlastimil Babka   2021-06-04  476   * Interrupts must be disabled (for the fallback code to work right), typically
a2b4ae8bfd9c10 Vlastimil Babka   2021-06-04  477   * by an _irqsave() lock variant. Except on PREEMPT_RT where locks are different
a2b4ae8bfd9c10 Vlastimil Babka   2021-06-04  478   * so we disable interrupts as part of slab_[un]lock().
a2b4ae8bfd9c10 Vlastimil Babka   2021-06-04  479   */
bb192ed9aa7191 Vlastimil Babka   2021-11-03  480  static inline bool __cmpxchg_double_slab(struct kmem_cache *s, struct slab *slab,
1d07171c5e58e6 Christoph Lameter 2011-07-14  481  		void *freelist_old, unsigned long counters_old,
1d07171c5e58e6 Christoph Lameter 2011-07-14  482  		void *freelist_new, unsigned long counters_new,
1d07171c5e58e6 Christoph Lameter 2011-07-14  483  		const char *n)
1d07171c5e58e6 Christoph Lameter 2011-07-14  484  {
a2b4ae8bfd9c10 Vlastimil Babka   2021-06-04  485  	if (!IS_ENABLED(CONFIG_PREEMPT_RT))
a2b4ae8bfd9c10 Vlastimil Babka   2021-06-04 @486  		lockdep_assert_irqs_disabled();
2565409fc0303f Heiko Carstens    2012-01-12  487  #if defined(CONFIG_HAVE_CMPXCHG_DOUBLE) && \
2565409fc0303f Heiko Carstens    2012-01-12  488      defined(CONFIG_HAVE_ALIGNED_STRUCT_PAGE)
1d07171c5e58e6 Christoph Lameter 2011-07-14  489  	if (s->flags & __CMPXCHG_DOUBLE) {
bb192ed9aa7191 Vlastimil Babka   2021-11-03  490  		if (cmpxchg_double(&slab->freelist, &slab->counters,
1d07171c5e58e6 Christoph Lameter 2011-07-14  491  				   freelist_old, counters_old,
1d07171c5e58e6 Christoph Lameter 2011-07-14  492  				   freelist_new, counters_new))
6f6528a1632cb9 Joe Perches       2015-04-14  493  			return true;
1d07171c5e58e6 Christoph Lameter 2011-07-14  494  	} else
1d07171c5e58e6 Christoph Lameter 2011-07-14  495  #endif
1d07171c5e58e6 Christoph Lameter 2011-07-14  496  	{
a2b4ae8bfd9c10 Vlastimil Babka   2021-06-04  497  		/* init to 0 to prevent spurious warnings */
a2b4ae8bfd9c10 Vlastimil Babka   2021-06-04  498  		unsigned long flags = 0;
a2b4ae8bfd9c10 Vlastimil Babka   2021-06-04  499  
bb192ed9aa7191 Vlastimil Babka   2021-11-03  500  		slab_lock(slab, &flags);
bb192ed9aa7191 Vlastimil Babka   2021-11-03  501  		if (slab->freelist == freelist_old &&
bb192ed9aa7191 Vlastimil Babka   2021-11-03  502  					slab->counters == counters_old) {
bb192ed9aa7191 Vlastimil Babka   2021-11-03  503  			slab->freelist = freelist_new;
bb192ed9aa7191 Vlastimil Babka   2021-11-03  504  			slab->counters = counters_new;
bb192ed9aa7191 Vlastimil Babka   2021-11-03  505  			slab_unlock(slab, &flags);
6f6528a1632cb9 Joe Perches       2015-04-14  506  			return true;
1d07171c5e58e6 Christoph Lameter 2011-07-14  507  		}
bb192ed9aa7191 Vlastimil Babka   2021-11-03  508  		slab_unlock(slab, &flags);
1d07171c5e58e6 Christoph Lameter 2011-07-14  509  	}
1d07171c5e58e6 Christoph Lameter 2011-07-14  510  
1d07171c5e58e6 Christoph Lameter 2011-07-14  511  	cpu_relax();
1d07171c5e58e6 Christoph Lameter 2011-07-14  512  	stat(s, CMPXCHG_DOUBLE_FAIL);
1d07171c5e58e6 Christoph Lameter 2011-07-14  513  

:::::: The code at line 486 was first introduced by commit
:::::: a2b4ae8bfd9c10e3c1c1966bd3c8d8b7c9026aaf mm, slub: make slab_lock() disable irqs with PREEMPT_RT

:::::: TO: Vlastimil Babka <vbabka@...e.cz>
:::::: CC: Vlastimil Babka <vbabka@...e.cz>

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

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ