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>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 15 May 2019 15:04:34 -0700
From:   Jakub Kicinski <jakub.kicinski@...ronome.com>
To:     NeilBrown <neilb@...e.com>
Cc:     davem@...emloft.net, herbert@...dor.apana.org.au, tgraf@...g.ch,
        netdev@...r.kernel.org, oss-drivers@...ronome.com,
        Simon Horman <simon.horman@...ronome.com>
Subject: Re: [PATCH net] rhashtable: fix sparse RCU warnings on bit lock in
 bucket pointer

On Thu, 16 May 2019 07:42:29 +1000, NeilBrown wrote:
> On Wed, May 15 2019, Jakub Kicinski wrote:
> 
> > Since the bit_spin_lock() operations don't actually dereference
> > the pointer, it's fine to forcefully drop the RCU annotation.
> > This fixes 7 sparse warnings per include site.
> >
> > Fixes: 8f0db018006a ("rhashtable: use bit_spin_locks to protect hash bucket.")
> > Signed-off-by: Jakub Kicinski <jakub.kicinski@...ronome.com>
> > Reviewed-by: Simon Horman <simon.horman@...ronome.com>  
> 
> Hi, sorry for not responding to your initial post, but I'm otherwise
> engaged this week and cannot give it any real time.  I don't object to
> this patch, but I'll try to have a proper look next week, if only to
> find out how I didn't get the warnings, as I was testing with sparse.

You gave me a scare :)  I pulled latest sparse and they seem to still
be there (previously I was testing with sparse 5.2).  Note that I'm
just fixing the warnings in the header, those are particularly noisy as
they get printed for each include site.

$ gcc-9 --version
gcc-9 (Ubuntu 9-20190428-1ubuntu1~18.04.york0) 9.0.1 20190428 (prerelease) [gcc-9-branch revision 270630]
  [...]
$ sparse --version
v0.6.1-rc1-7-g2b96cd80
$ git checkout net/master
$ make CC=gcc-9 O=build_net-perf/ -j 32 W=1 C=1 
make[1]: Entering directory '/home/jkicinski/devel/linux/build_net-perf'
  GEN     Makefile
  DESCEND  objtool
  Using .. as source for kernel
  CALL    ../scripts/atomic/check-atomics.sh
  CALL    ../scripts/checksyscalls.sh
  CHK     include/generated/compile.h
  CHECK   ../lib/rhashtable.c
../lib/rhashtable.c:134:13: warning: incorrect type in initializer (different address spaces)
../lib/rhashtable.c:134:13:    expected union nested_table [noderef] <asn:4> *__new
../lib/rhashtable.c:134:13:    got union nested_table *[assigned] ntbl
../lib/rhashtable.c:250:51: warning: incorrect type in argument 2 (different address spaces)
../lib/rhashtable.c:250:51:    expected struct rhash_lock_head **bucket
../lib/rhashtable.c:250:51:    got struct rhash_lock_head [noderef] <asn:4> **
../lib/rhashtable.c:277:27: warning: incorrect type in argument 2 (different address spaces)
../lib/rhashtable.c:277:27:    expected struct rhash_lock_head **bkt
../lib/rhashtable.c:277:27:    got struct rhash_lock_head [noderef] <asn:4> **bkt
../lib/rhashtable.c:284:29: warning: incorrect type in argument 2 (different address spaces)
../lib/rhashtable.c:284:29:    expected struct rhash_lock_head **bkt
../lib/rhashtable.c:284:29:    got struct rhash_lock_head [noderef] <asn:4> **bkt
../lib/rhashtable.c:299:13: warning: incorrect type in initializer (different address spaces)
../lib/rhashtable.c:299:13:    expected struct bucket_table [noderef] <asn:4> *__new
../lib/rhashtable.c:299:13:    got struct bucket_table *new_tbl
../lib/rhashtable.c:605:39: warning: incorrect type in argument 2 (different address spaces)
../lib/rhashtable.c:605:39:    expected struct rhash_lock_head **bkt
../lib/rhashtable.c:605:39:    got struct rhash_lock_head [noderef] <asn:4> **[assigned] bkt
../lib/rhashtable.c:613:41: warning: incorrect type in argument 2 (different address spaces)
../lib/rhashtable.c:613:41:    expected struct rhash_lock_head **bkt
../lib/rhashtable.c:613:41:    got struct rhash_lock_head [noderef] <asn:4> **[assigned] bkt
  [...]
$ git checkout rht-fix
$ make CC=gcc-9 O=build_net-perf/ -j 32 W=1 C=1 
  [...all things get rebuilt...]
$ touch lib/rhashtable.c
$ make CC=gcc-9 O=build_net-perf/ -j 32 W=1 C=1 
make[1]: Entering directory '/home/jkicinski/devel/linux/build_net-perf'
  GEN     Makefile
  DESCEND  objtool
  Using .. as source for kernel
  CALL    ../scripts/atomic/check-atomics.sh
  CALL    ../scripts/checksyscalls.sh
  CHK     include/generated/compile.h
  CHECK   ../lib/rhashtable.c
../lib/rhashtable.c:134:13: warning: incorrect type in initializer (different address spaces)
../lib/rhashtable.c:134:13:    expected union nested_table [noderef] <asn:4> *__new
../lib/rhashtable.c:134:13:    got union nested_table *[assigned] ntbl
../lib/rhashtable.c:299:13: warning: incorrect type in initializer (different address spaces)
../lib/rhashtable.c:299:13:    expected struct bucket_table [noderef] <asn:4> *__new
../lib/rhashtable.c:299:13:    got struct bucket_table *new_tbl
  [...]

Powered by blists - more mailing lists