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: <202209211209.ikyCliaa-lkp@intel.com>
Date:   Wed, 21 Sep 2022 12:50:57 +0800
From:   kernel test robot <lkp@...el.com>
To:     Mark Rutland <mark.rutland@....com>
Cc:     kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org,
        Peter Zijlstra <peterz@...radead.org>
Subject: include/linux/atomic/atomic-instrumented.h:476:16: sparse: sparse:
 cast truncates bits from constant value (ffffffffaaa31337 becomes 37)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   60891ec99e141b74544d11e897a245ef06263052
commit: e3d18cee258b898017b298b5b93f8134dd62aee3 locking/atomic: centralize generated headers
date:   1 year, 2 months ago
config: ia64-randconfig-s053-20220921 (https://download.01.org/0day-ci/archive/20220921/202209211209.ikyCliaa-lkp@intel.com/config)
compiler: ia64-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=e3d18cee258b898017b298b5b93f8134dd62aee3
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout e3d18cee258b898017b298b5b93f8134dd62aee3
        # 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=ia64 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 >>)
   lib/atomic64_test.c: note: in included file (through include/linux/atomic.h):
>> include/linux/atomic/atomic-instrumented.h:476:16: sparse: sparse: cast truncates bits from constant value (ffffffffaaa31337 becomes 37)
   include/linux/atomic/atomic-instrumented.h:476:16: sparse: sparse: cast truncates bits from constant value (ffffffffaaa31337 becomes 1337)
   include/linux/atomic/atomic-instrumented.h:483:16: sparse: sparse: cast truncates bits from constant value (ffffffffaaa31337 becomes 37)
   include/linux/atomic/atomic-instrumented.h:483:16: sparse: sparse: cast truncates bits from constant value (ffffffffaaa31337 becomes 1337)
   include/linux/atomic/atomic-instrumented.h:490:16: sparse: sparse: cast truncates bits from constant value (ffffffffaaa31337 becomes 37)
   include/linux/atomic/atomic-instrumented.h:490:16: sparse: sparse: cast truncates bits from constant value (ffffffffaaa31337 becomes 1337)
   include/linux/atomic/atomic-instrumented.h:497:16: sparse: sparse: cast truncates bits from constant value (ffffffffaaa31337 becomes 37)
   include/linux/atomic/atomic-instrumented.h:497:16: sparse: sparse: cast truncates bits from constant value (ffffffffaaa31337 becomes 1337)
>> include/linux/atomic/atomic-instrumented.h:476:16: sparse: sparse: cast truncates bits from constant value (11112222 becomes 22)
   include/linux/atomic/atomic-instrumented.h:476:16: sparse: sparse: cast truncates bits from constant value (11112222 becomes 2222)
   include/linux/atomic/atomic-instrumented.h:483:16: sparse: sparse: cast truncates bits from constant value (11112222 becomes 22)
   include/linux/atomic/atomic-instrumented.h:483:16: sparse: sparse: cast truncates bits from constant value (11112222 becomes 2222)
   include/linux/atomic/atomic-instrumented.h:490:16: sparse: sparse: cast truncates bits from constant value (11112222 becomes 22)
   include/linux/atomic/atomic-instrumented.h:490:16: sparse: sparse: cast truncates bits from constant value (11112222 becomes 2222)
   include/linux/atomic/atomic-instrumented.h:497:16: sparse: sparse: cast truncates bits from constant value (11112222 becomes 22)
   include/linux/atomic/atomic-instrumented.h:497:16: sparse: sparse: cast truncates bits from constant value (11112222 becomes 2222)
>> include/linux/atomic/atomic-instrumented.h:1054:16: sparse: sparse: cast truncates bits from constant value (aaa31337c001d00d becomes d)
>> include/linux/atomic/atomic-instrumented.h:1054:16: sparse: sparse: cast truncates bits from constant value (aaa31337c001d00d becomes d00d)
>> include/linux/atomic/atomic-instrumented.h:1054:16: sparse: sparse: cast truncates bits from constant value (aaa31337c001d00d becomes c001d00d)
   include/linux/atomic/atomic-instrumented.h:1061:16: sparse: sparse: cast truncates bits from constant value (aaa31337c001d00d becomes d)
   include/linux/atomic/atomic-instrumented.h:1061:16: sparse: sparse: cast truncates bits from constant value (aaa31337c001d00d becomes d00d)
   include/linux/atomic/atomic-instrumented.h:1061:16: sparse: sparse: cast truncates bits from constant value (aaa31337c001d00d becomes c001d00d)
   include/linux/atomic/atomic-instrumented.h:1068:16: sparse: sparse: cast truncates bits from constant value (aaa31337c001d00d becomes d)
   include/linux/atomic/atomic-instrumented.h:1068:16: sparse: sparse: cast truncates bits from constant value (aaa31337c001d00d becomes d00d)
   include/linux/atomic/atomic-instrumented.h:1068:16: sparse: sparse: cast truncates bits from constant value (aaa31337c001d00d becomes c001d00d)
   include/linux/atomic/atomic-instrumented.h:1075:16: sparse: sparse: cast truncates bits from constant value (aaa31337c001d00d becomes d)
   include/linux/atomic/atomic-instrumented.h:1075:16: sparse: sparse: cast truncates bits from constant value (aaa31337c001d00d becomes d00d)
   include/linux/atomic/atomic-instrumented.h:1075:16: sparse: sparse: cast truncates bits from constant value (aaa31337c001d00d becomes c001d00d)
>> include/linux/atomic/atomic-instrumented.h:1054:16: sparse: sparse: cast truncates bits from constant value (faceabadf00df001 becomes 1)
>> include/linux/atomic/atomic-instrumented.h:1054:16: sparse: sparse: cast truncates bits from constant value (faceabadf00df001 becomes f001)
>> include/linux/atomic/atomic-instrumented.h:1054:16: sparse: sparse: cast truncates bits from constant value (faceabadf00df001 becomes f00df001)
   include/linux/atomic/atomic-instrumented.h:1061:16: sparse: sparse: cast truncates bits from constant value (faceabadf00df001 becomes 1)
   include/linux/atomic/atomic-instrumented.h:1061:16: sparse: sparse: cast truncates bits from constant value (faceabadf00df001 becomes f001)
   include/linux/atomic/atomic-instrumented.h:1061:16: sparse: sparse: cast truncates bits from constant value (faceabadf00df001 becomes f00df001)
   include/linux/atomic/atomic-instrumented.h:1068:16: sparse: sparse: cast truncates bits from constant value (faceabadf00df001 becomes 1)
   include/linux/atomic/atomic-instrumented.h:1068:16: sparse: sparse: cast truncates bits from constant value (faceabadf00df001 becomes f001)
   include/linux/atomic/atomic-instrumented.h:1068:16: sparse: sparse: cast truncates bits from constant value (faceabadf00df001 becomes f00df001)
   include/linux/atomic/atomic-instrumented.h:1075:16: sparse: sparse: cast truncates bits from constant value (faceabadf00df001 becomes 1)
   include/linux/atomic/atomic-instrumented.h:1075:16: sparse: sparse: cast truncates bits from constant value (faceabadf00df001 becomes f001)
   include/linux/atomic/atomic-instrumented.h:1075:16: sparse: sparse: cast truncates bits from constant value (faceabadf00df001 becomes f00df001)

vim +476 include/linux/atomic/atomic-instrumented.h

aa525d063851a9 include/asm-generic/atomic-instrumented.h Mark Rutland 2018-09-04  471  
c020395b6634b7 include/asm-generic/atomic-instrumented.h Marco Elver  2019-11-26  472  static __always_inline int
aa525d063851a9 include/asm-generic/atomic-instrumented.h Mark Rutland 2018-09-04  473  atomic_cmpxchg(atomic_t *v, int old, int new)
aa525d063851a9 include/asm-generic/atomic-instrumented.h Mark Rutland 2018-09-04  474  {
3570a1bcf45e9a include/asm-generic/atomic-instrumented.h Marco Elver  2020-07-24  475  	instrument_atomic_read_write(v, sizeof(*v));
aa525d063851a9 include/asm-generic/atomic-instrumented.h Mark Rutland 2018-09-04 @476  	return arch_atomic_cmpxchg(v, old, new);
aa525d063851a9 include/asm-generic/atomic-instrumented.h Mark Rutland 2018-09-04  477  }
aa525d063851a9 include/asm-generic/atomic-instrumented.h Mark Rutland 2018-09-04  478  
c020395b6634b7 include/asm-generic/atomic-instrumented.h Marco Elver  2019-11-26  479  static __always_inline int
aa525d063851a9 include/asm-generic/atomic-instrumented.h Mark Rutland 2018-09-04  480  atomic_cmpxchg_acquire(atomic_t *v, int old, int new)
aa525d063851a9 include/asm-generic/atomic-instrumented.h Mark Rutland 2018-09-04  481  {
3570a1bcf45e9a include/asm-generic/atomic-instrumented.h Marco Elver  2020-07-24  482  	instrument_atomic_read_write(v, sizeof(*v));
aa525d063851a9 include/asm-generic/atomic-instrumented.h Mark Rutland 2018-09-04  483  	return arch_atomic_cmpxchg_acquire(v, old, new);
aa525d063851a9 include/asm-generic/atomic-instrumented.h Mark Rutland 2018-09-04  484  }
aa525d063851a9 include/asm-generic/atomic-instrumented.h Mark Rutland 2018-09-04  485  
c020395b6634b7 include/asm-generic/atomic-instrumented.h Marco Elver  2019-11-26  486  static __always_inline int
aa525d063851a9 include/asm-generic/atomic-instrumented.h Mark Rutland 2018-09-04  487  atomic_cmpxchg_release(atomic_t *v, int old, int new)
aa525d063851a9 include/asm-generic/atomic-instrumented.h Mark Rutland 2018-09-04  488  {
3570a1bcf45e9a include/asm-generic/atomic-instrumented.h Marco Elver  2020-07-24  489  	instrument_atomic_read_write(v, sizeof(*v));
aa525d063851a9 include/asm-generic/atomic-instrumented.h Mark Rutland 2018-09-04  490  	return arch_atomic_cmpxchg_release(v, old, new);
aa525d063851a9 include/asm-generic/atomic-instrumented.h Mark Rutland 2018-09-04  491  }
aa525d063851a9 include/asm-generic/atomic-instrumented.h Mark Rutland 2018-09-04  492  
c020395b6634b7 include/asm-generic/atomic-instrumented.h Marco Elver  2019-11-26  493  static __always_inline int
aa525d063851a9 include/asm-generic/atomic-instrumented.h Mark Rutland 2018-09-04  494  atomic_cmpxchg_relaxed(atomic_t *v, int old, int new)
aa525d063851a9 include/asm-generic/atomic-instrumented.h Mark Rutland 2018-09-04  495  {
3570a1bcf45e9a include/asm-generic/atomic-instrumented.h Marco Elver  2020-07-24  496  	instrument_atomic_read_write(v, sizeof(*v));
aa525d063851a9 include/asm-generic/atomic-instrumented.h Mark Rutland 2018-09-04 @497  	return arch_atomic_cmpxchg_relaxed(v, old, new);
aa525d063851a9 include/asm-generic/atomic-instrumented.h Mark Rutland 2018-09-04  498  }
aa525d063851a9 include/asm-generic/atomic-instrumented.h Mark Rutland 2018-09-04  499  

:::::: The code at line 476 was first introduced by commit
:::::: aa525d063851a98e020b827fdd1d7776ae652301 locking/atomics: Switch to generated instrumentation

:::::: TO: Mark Rutland <mark.rutland@....com>
:::::: CC: Ingo Molnar <mingo@...nel.org>

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ