Skip to contentSkip to conversation

net/netfilter/nf_nat_amanda.c:75:9: sparse: sparse: incorrect type in assignment (different modifiers)

DISCUSSION kernel test robot 2 participants 2 messages Mar 2 – Mar 3

lore
Share & tools
lore

kernel test robot

author build bot
#0 lore raw

Hi Sun,

FYI, the error/warning was bisected to this commit, please ignore it if it's irrelevant.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   11439c4635edd669ae435eec308f4ab8a0804808
commit: 07919126ecfc392102555a70016db3e591abcb3d netfilter: annotate NAT helper hook pointers with __rcu
date:   13 days ago
config: x86_64-randconfig-r123-20260302 (https://download.01.org/0day-ci/archive/20260302/[email protected]/config)
compiler: gcc-13 (Debian 13.3.0-16) 13.3.0
sparse: v0.6.5-rc1
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260302/[email protected]/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 <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

sparse warnings: (new ones prefixed by >>)

>> net/netfilter/nf_nat_amanda.c:75:9: sparse: sparse: incorrect type in assignment (different modifiers) @@     expected unsigned int ( [noderef] __rcu *volatile  )( ... ) @@     got unsigned int ( [noderef] __rcu * )( ... ) @@

net/netfilter/nf_nat_amanda.c:75:9: sparse: expected unsigned int ( [noderef] __rcu *volatile )( ... )
net/netfilter/nf_nat_amanda.c:75:9: sparse: got unsigned int ( [noderef] __rcu * )( ... )

vim +75 net/netfilter/nf_nat_amanda.c

16958900578b945 net/ipv4/netfilter/nf_nat_amanda.c Patrick McHardy   2006-12-02  70  
16958900578b945 net/ipv4/netfilter/nf_nat_amanda.c Patrick McHardy   2006-12-02  71  static int __init nf_nat_amanda_init(void)
16958900578b945 net/ipv4/netfilter/nf_nat_amanda.c Patrick McHardy   2006-12-02  72  {
d1332e0ab84479d net/ipv4/netfilter/nf_nat_amanda.c Patrick McHardy   2007-11-05  73  	BUG_ON(nf_nat_amanda_hook != NULL);
53b11308a1b53d7 net/netfilter/nf_nat_amanda.c      Flavio Leitner    2019-04-17  74  	nf_nat_helper_register(&nat_helper_amanda);
a9b3cd7f323b2e5 net/ipv4/netfilter/nf_nat_amanda.c Stephen Hemminger 2011-08-01 @75  	RCU_INIT_POINTER(nf_nat_amanda_hook, help);
16958900578b945 net/ipv4/netfilter/nf_nat_amanda.c Patrick McHardy   2006-12-02  76  	return 0;
16958900578b945 net/ipv4/netfilter/nf_nat_amanda.c Patrick McHardy   2006-12-02  77  }

16958900578b945 net/ipv4/netfilter/nf_nat_amanda.c Patrick McHardy 2006-12-02 78

:::::: The code at line 75 was first introduced by commit
:::::: a9b3cd7f323b2e57593e7215362a7b02fc933e3a rcu: convert uses of rcu_assign_pointer(x, NULL) to RCU_INIT_POINTER

:::::: TO: Stephen Hemminger <[email protected]> :::::: CC: David S. Miller <[email protected]>

Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
#1 lore raw
Quoted 8 lines · kernel test robot

Hi Sun,

FYI, the error/warning was bisected to this commit, please ignore it if it's irrelevant.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   11439c4635edd669ae435eec308f4ab8a0804808
commit: 07919126ecfc392102555a70016db3e591abcb3d netfilter: annotate NAT helper hook pointers with __rcu

Thanks for the report. I can reproduce it and will send a separate follow-up patch shortly to address the sparse warnings.
Sun Jian