Re: [PATCH nf-next 2/3] netfilter: add struct nf_nat_hook and use it

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Pablo,

I love your patch! Perhaps something to improve:

[auto build test WARNING on nf-next/master]

url:    https://github.com/0day-ci/linux/commits/Pablo-Neira-Ayuso/netfilter-add-struct-nf_ct_hook-and-use-it/20180515-034151
base:   https://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf-next.git master
reproduce:
        # apt-get install sparse
        make ARCH=x86_64 allmodconfig
        make C=1 CF=-D__CHECK_ENDIAN__


sparse warnings: (new ones prefixed by >>)

   net/xfrm/xfrm_policy.c:592:22: sparse: incorrect type in assignment (different address spaces) @@    expected struct hlist_head *odst @@    got struct hlist_headstruct hlist_head *odst @@
   net/xfrm/xfrm_policy.c:592:22:    expected struct hlist_head *odst
   net/xfrm/xfrm_policy.c:592:22:    got struct hlist_head [noderef] <asn:4>*table
>> include/net/netfilter/nf_nat_core.h:44:20: sparse: incorrect type in argument 1 (different address spaces) @@    expected void const volatile *p @@    got struct nf_nat_hoovoid const volatile *p @@
   include/net/netfilter/nf_nat_core.h:44:20:    expected void const volatile *p
   include/net/netfilter/nf_nat_core.h:44:20:    got struct nf_nat_hook *[noderef] <asn:4>*<noident>
>> include/net/netfilter/nf_nat_core.h:44:20: sparse: incorrect type in argument 1 (different address spaces) @@    expected void const volatile *p @@    got struct nf_nat_hoovoid const volatile *p @@
   include/net/netfilter/nf_nat_core.h:44:20:    expected void const volatile *p
   include/net/netfilter/nf_nat_core.h:44:20:    got struct nf_nat_hook *[noderef] <asn:4>*<noident>
>> include/net/netfilter/nf_nat_core.h:44:20: sparse: incompatible types in comparison expression (different address spaces)
   net/xfrm/xfrm_policy.c:2808:43: sparse: incompatible types in comparison expression (different address spaces)
   net/xfrm/xfrm_policy.c:2879:29: sparse: incorrect type in assignment (different address spaces) @@    expected struct hlist_head [noderef] <asn:4>*table @@    got  [noderef] <asn:4>*table @@
   net/xfrm/xfrm_policy.c:2879:29:    expected struct hlist_head [noderef] <asn:4>*table
   net/xfrm/xfrm_policy.c:2879:29:    got struct hlist_head *
   net/xfrm/xfrm_policy.c:2905:36: sparse: incorrect type in argument 1 (different address spaces) @@    expected struct hlist_head *n @@    got struct hlist_headstruct hlist_head *n @@
   net/xfrm/xfrm_policy.c:2905:36:    expected struct hlist_head *n
   net/xfrm/xfrm_policy.c:2905:36:    got struct hlist_head [noderef] <asn:4>*table
   net/xfrm/xfrm_policy.c:2932:17: sparse: incorrect type in argument 1 (different address spaces) @@    expected struct hlist_head const *h @@    got struct hlisstruct hlist_head const *h @@
   net/xfrm/xfrm_policy.c:2932:17:    expected struct hlist_head const *h
   net/xfrm/xfrm_policy.c:2932:17:    got struct hlist_head [noderef] <asn:4>*table
   net/xfrm/xfrm_policy.c:2933:36: sparse: incorrect type in argument 1 (different address spaces) @@    expected struct hlist_head *n @@    got struct hlist_headstruct hlist_head *n @@
   net/xfrm/xfrm_policy.c:2933:36:    expected struct hlist_head *n
   net/xfrm/xfrm_policy.c:2933:36:    got struct hlist_head [noderef] <asn:4>*table
   net/xfrm/xfrm_policy.c:109:40: sparse: context imbalance in 'xfrm_policy_get_afinfo' - different lock contexts for basic block
   include/linux/rcupdate.h:686:9: sparse: context imbalance in '__xfrm_dst_lookup' - unexpected unlock
   net/xfrm/xfrm_policy.c:900:25: sparse: dereference of noderef expression
   net/xfrm/xfrm_policy.c:958:25: sparse: dereference of noderef expression
   include/linux/rcupdate.h:686:9: sparse: context imbalance in 'xfrm_get_saddr' - unexpected unlock
   include/linux/rcupdate.h:686:9: sparse: context imbalance in 'xfrm_get_tos' - unexpected unlock
   include/linux/rcupdate.h:686:9: sparse: context imbalance in 'xfrm_bundle_create' - unexpected unlock
   include/linux/rcupdate.h:686:9: sparse: context imbalance in 'xfrm_create_dummy_bundle' - unexpected unlock
   include/linux/rcupdate.h:686:9: sparse: context imbalance in 'make_blackhole' - unexpected unlock
   include/linux/rcupdate.h:686:9: sparse: context imbalance in '__xfrm_decode_session' - unexpected unlock

vim +44 include/net/netfilter/nf_nat_core.h

    36	
    37	static inline void
    38	nf_nat_decode_session(struct sk_buff *skb, struct flowi *fl, u_int8_t family)
    39	{
    40	#ifdef CONFIG_NF_NAT_NEEDED
    41		struct nf_nat_hook *nat_hook;
    42	
    43		rcu_read_lock();
  > 44		nat_hook = rcu_dereference(nf_nat_hook);
    45		if (nat_hook->decode_session)
    46			nat_hook->decode_session(skb, fl);
    47		rcu_read_unlock();
    48	#endif
    49	}
    50	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux