Re: [PATCH nf-next] netfilter: ctnetlink: don't dump ct extensions of unconfirmed conntracks

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

 



Hi Florian,

I love your patch! Perhaps something to improve:

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

url:    https://github.com/0day-ci/linux/commits/Florian-Westphal/netfilter-ctnetlink-don-t-dump-ct-extensions-of-unconfirmed-conntracks/20191015-040005
base:   https://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf-next.git master
config: i386-randconfig-g004-201941 (attached as .config)
compiler: gcc-7 (Debian 7.4.0-13) 7.4.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@xxxxxxxxx>

All warnings (new ones prefixed by >>):

   In file included from include/linux/init.h:5:0,
                    from net/netfilter/nf_conntrack_netlink.c:18:
   net/netfilter/nf_conntrack_netlink.c: In function 'ctnetlink_dump_extinfo':
   net/netfilter/nf_conntrack_netlink.c:520:37: warning: passing argument 2 of 'ctnetlink_dump_ct_seq_adj' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
         ctnetlink_dump_ct_seq_adj(skb, ct) < 0 ||
                                        ^
   include/linux/compiler.h:58:52: note: in definition of macro '__trace_if_var'
    #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                                       ^~~~
>> net/netfilter/nf_conntrack_netlink.c:516:2: note: in expansion of macro 'if'
     if (ctnetlink_dump_acct(skb, ct, type) < 0 ||
     ^~
   net/netfilter/nf_conntrack_netlink.c:438:12: note: expected 'struct nf_conn *' but argument is of type 'const struct nf_conn *'
    static int ctnetlink_dump_ct_seq_adj(struct sk_buff *skb, struct nf_conn *ct)
               ^~~~~~~~~~~~~~~~~~~~~~~~~
   In file included from include/linux/init.h:5:0,
                    from net/netfilter/nf_conntrack_netlink.c:18:
   net/netfilter/nf_conntrack_netlink.c:521:38: warning: passing argument 2 of 'ctnetlink_dump_ct_synproxy' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
         ctnetlink_dump_ct_synproxy(skb, ct) < 0)
                                         ^
   include/linux/compiler.h:58:52: note: in definition of macro '__trace_if_var'
    #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                                       ^~~~
>> net/netfilter/nf_conntrack_netlink.c:516:2: note: in expansion of macro 'if'
     if (ctnetlink_dump_acct(skb, ct, type) < 0 ||
     ^~
   net/netfilter/nf_conntrack_netlink.c:462:12: note: expected 'struct nf_conn *' but argument is of type 'const struct nf_conn *'
    static int ctnetlink_dump_ct_synproxy(struct sk_buff *skb, struct nf_conn *ct)
               ^~~~~~~~~~~~~~~~~~~~~~~~~~
   In file included from include/linux/init.h:5:0,
                    from net/netfilter/nf_conntrack_netlink.c:18:
   net/netfilter/nf_conntrack_netlink.c:520:37: warning: passing argument 2 of 'ctnetlink_dump_ct_seq_adj' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
         ctnetlink_dump_ct_seq_adj(skb, ct) < 0 ||
                                        ^
   include/linux/compiler.h:58:61: note: in definition of macro '__trace_if_var'
    #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                                                ^~~~
>> net/netfilter/nf_conntrack_netlink.c:516:2: note: in expansion of macro 'if'
     if (ctnetlink_dump_acct(skb, ct, type) < 0 ||
     ^~
   net/netfilter/nf_conntrack_netlink.c:438:12: note: expected 'struct nf_conn *' but argument is of type 'const struct nf_conn *'
    static int ctnetlink_dump_ct_seq_adj(struct sk_buff *skb, struct nf_conn *ct)
               ^~~~~~~~~~~~~~~~~~~~~~~~~
   In file included from include/linux/init.h:5:0,
                    from net/netfilter/nf_conntrack_netlink.c:18:
   net/netfilter/nf_conntrack_netlink.c:521:38: warning: passing argument 2 of 'ctnetlink_dump_ct_synproxy' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
         ctnetlink_dump_ct_synproxy(skb, ct) < 0)
                                         ^
   include/linux/compiler.h:58:61: note: in definition of macro '__trace_if_var'
    #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                                                ^~~~
>> net/netfilter/nf_conntrack_netlink.c:516:2: note: in expansion of macro 'if'
     if (ctnetlink_dump_acct(skb, ct, type) < 0 ||
     ^~
   net/netfilter/nf_conntrack_netlink.c:462:12: note: expected 'struct nf_conn *' but argument is of type 'const struct nf_conn *'
    static int ctnetlink_dump_ct_synproxy(struct sk_buff *skb, struct nf_conn *ct)
               ^~~~~~~~~~~~~~~~~~~~~~~~~~
   In file included from include/linux/init.h:5:0,
                    from net/netfilter/nf_conntrack_netlink.c:18:
   net/netfilter/nf_conntrack_netlink.c:520:37: warning: passing argument 2 of 'ctnetlink_dump_ct_seq_adj' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
         ctnetlink_dump_ct_seq_adj(skb, ct) < 0 ||
                                        ^
   include/linux/compiler.h:69:3: note: in definition of macro '__trace_if_value'
     (cond) ?     \
      ^~~~
   include/linux/compiler.h:56:28: note: in expansion of macro '__trace_if_var'
    #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                               ^~~~~~~~~~~~~~
>> net/netfilter/nf_conntrack_netlink.c:516:2: note: in expansion of macro 'if'
     if (ctnetlink_dump_acct(skb, ct, type) < 0 ||
     ^~
   net/netfilter/nf_conntrack_netlink.c:438:12: note: expected 'struct nf_conn *' but argument is of type 'const struct nf_conn *'
    static int ctnetlink_dump_ct_seq_adj(struct sk_buff *skb, struct nf_conn *ct)
               ^~~~~~~~~~~~~~~~~~~~~~~~~
   In file included from include/linux/init.h:5:0,
                    from net/netfilter/nf_conntrack_netlink.c:18:
   net/netfilter/nf_conntrack_netlink.c:521:38: warning: passing argument 2 of 'ctnetlink_dump_ct_synproxy' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
         ctnetlink_dump_ct_synproxy(skb, ct) < 0)
                                         ^
   include/linux/compiler.h:69:3: note: in definition of macro '__trace_if_value'
     (cond) ?     \
      ^~~~
   include/linux/compiler.h:56:28: note: in expansion of macro '__trace_if_var'
    #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                               ^~~~~~~~~~~~~~
>> net/netfilter/nf_conntrack_netlink.c:516:2: note: in expansion of macro 'if'
     if (ctnetlink_dump_acct(skb, ct, type) < 0 ||
     ^~
   net/netfilter/nf_conntrack_netlink.c:462:12: note: expected 'struct nf_conn *' but argument is of type 'const struct nf_conn *'
    static int ctnetlink_dump_ct_synproxy(struct sk_buff *skb, struct nf_conn *ct)
               ^~~~~~~~~~~~~~~~~~~~~~~~~~
   net/netfilter/nf_conntrack_netlink.c: In function 'ctnetlink_dump_info':
   net/netfilter/nf_conntrack_netlink.c:542:1: warning: control reaches end of non-void function [-Wreturn-type]
    }
    ^
   Cyclomatic Complexity 5 include/linux/compiler.h:__read_once_size
   Cyclomatic Complexity 5 include/linux/compiler.h:__write_once_size
   Cyclomatic Complexity 1 include/linux/kasan-checks.h:kasan_check_read
   Cyclomatic Complexity 1 include/linux/kasan-checks.h:kasan_check_write
   Cyclomatic Complexity 4 arch/x86/include/asm/bitops.h:arch_set_bit
   Cyclomatic Complexity 1 arch/x86/include/asm/bitops.h:arch___set_bit
   Cyclomatic Complexity 4 arch/x86/include/asm/bitops.h:arch_clear_bit
   Cyclomatic Complexity 1 arch/x86/include/asm/bitops.h:constant_test_bit
   Cyclomatic Complexity 1 arch/x86/include/asm/bitops.h:variable_test_bit
   Cyclomatic Complexity 1 arch/x86/include/asm/bitops.h:fls
   Cyclomatic Complexity 1 include/asm-generic/bitops-instrumented.h:set_bit
   Cyclomatic Complexity 1 include/asm-generic/bitops-instrumented.h:__set_bit
   Cyclomatic Complexity 1 include/asm-generic/bitops-instrumented.h:clear_bit
   Cyclomatic Complexity 1 include/uapi/linux/byteorder/little_endian.h:__le32_to_cpup
   Cyclomatic Complexity 1 include/linux/log2.h:__ilog2_u32
   Cyclomatic Complexity 2 arch/x86/include/asm/jump_label.h:arch_static_branch_jump
   Cyclomatic Complexity 1 arch/x86/include/asm/atomic.h:arch_atomic_read
   Cyclomatic Complexity 1 arch/x86/include/asm/atomic.h:arch_atomic_inc
   Cyclomatic Complexity 1 arch/x86/include/asm/atomic.h:arch_atomic_dec_and_test
   Cyclomatic Complexity 3 arch/x86/include/asm/atomic.h:arch_atomic_try_cmpxchg
   Cyclomatic Complexity 1 arch/x86/include/asm/atomic64_32.h:arch_atomic64_xchg
   Cyclomatic Complexity 1 arch/x86/include/asm/atomic64_32.h:arch_atomic64_read
   Cyclomatic Complexity 1 include/asm-generic/atomic-instrumented.h:atomic_read
   Cyclomatic Complexity 1 include/asm-generic/atomic-instrumented.h:atomic_inc
   Cyclomatic Complexity 1 include/asm-generic/atomic-instrumented.h:atomic_try_cmpxchg
   Cyclomatic Complexity 1 include/asm-generic/atomic-instrumented.h:atomic_dec_and_test
   Cyclomatic Complexity 1 include/asm-generic/atomic-instrumented.h:atomic64_read
   Cyclomatic Complexity 1 include/asm-generic/atomic-instrumented.h:atomic64_xchg
   Cyclomatic Complexity 1 include/linux/err.h:ERR_PTR
   Cyclomatic Complexity 1 include/linux/err.h:PTR_ERR
   Cyclomatic Complexity 9 arch/x86/include/asm/preempt.h:__preempt_count_add
   Cyclomatic Complexity 9 arch/x86/include/asm/preempt.h:__preempt_count_sub
   Cyclomatic Complexity 1 include/linux/spinlock.h:spin_lock_bh
   Cyclomatic Complexity 1 include/linux/spinlock.h:spin_unlock
   Cyclomatic Complexity 1 include/linux/spinlock.h:spin_unlock_bh
   Cyclomatic Complexity 1 include/linux/rcupdate.h:__rcu_read_lock
   Cyclomatic Complexity 1 include/linux/rcupdate.h:__rcu_read_unlock
   Cyclomatic Complexity 5 include/linux/rcupdate.h:rcu_read_lock
   Cyclomatic Complexity 1 include/linux/ktime.h:ktime_to_ns
   Cyclomatic Complexity 1 include/linux/list_nulls.h:is_a_nulls
   Cyclomatic Complexity 4 include/linux/slab.h:kmalloc_type
   Cyclomatic Complexity 84 include/linux/slab.h:kmalloc_index
   Cyclomatic Complexity 1 include/linux/slab.h:kmalloc_large
   Cyclomatic Complexity 10 include/linux/slab.h:kmalloc
   Cyclomatic Complexity 1 include/linux/slab.h:kzalloc
   Cyclomatic Complexity 1 include/linux/skbuff.h:skb_is_nonlinear
   Cyclomatic Complexity 1 include/linux/skbuff.h:skb_tail_pointer
   Cyclomatic Complexity 2 include/linux/skbuff.h:skb_tailroom
   Cyclomatic Complexity 1 include/net/net_namespace.h:net_eq
   Cyclomatic Complexity 1 include/net/net_namespace.h:read_pnet
   Cyclomatic Complexity 5 include/linux/netfilter.h:nf_inet_addr_cmp
   Cyclomatic Complexity 1 include/net/netlink.h:nlmsg_msg_size
   Cyclomatic Complexity 1 include/net/netlink.h:nlmsg_total_size
   Cyclomatic Complexity 1 include/net/netlink.h:nlmsg_data
   Cyclomatic Complexity 1 include/net/netlink.h:nlmsg_report
   Cyclomatic Complexity 1 include/net/netlink.h:nlmsg_end
   Cyclomatic Complexity 1 include/net/netlink.h:nla_data
   Cyclomatic Complexity 1 include/net/netlink.h:nla_len
   Cyclomatic Complexity 1 include/net/netlink.h:nla_get_be32
   Cyclomatic Complexity 1 include/net/netlink.h:nla_get_u8
   Cyclomatic Complexity 1 include/net/netlink.h:nla_get_in_addr
   Cyclomatic Complexity 1 include/net/netlink.h:nla_nest_end
   Cyclomatic Complexity 1 include/net/sock.h:sock_net
   Cyclomatic Complexity 1 include/net/netfilter/nf_conntrack.h:nf_ct_tuplehash_to_ctrack
   Cyclomatic Complexity 1 include/net/netfilter/nf_conntrack.h:nf_ct_l3num
   Cyclomatic Complexity 1 include/net/netfilter/nf_conntrack.h:nf_ct_protonum
   Cyclomatic Complexity 1 include/net/netfilter/nf_conntrack.h:nf_ct_net
   Cyclomatic Complexity 1 include/net/netfilter/nf_conntrack.h:nf_ct_expires
   Cyclomatic Complexity 1 include/net/netfilter/nf_conntrack.h:nf_ct_is_expired
   Cyclomatic Complexity 1 include/net/netfilter/nf_conntrack_zones.h:nf_ct_zone
   Cyclomatic Complexity 1 include/net/netfilter/nf_conntrack_zones.h:nf_ct_zone_init
   Cyclomatic Complexity 1 include/net/netfilter/nf_conntrack_extend.h:__nf_ct_ext_exist
   Cyclomatic Complexity 3 include/net/netfilter/nf_conntrack_extend.h:nf_ct_ext_exist
   Cyclomatic Complexity 3 include/net/netfilter/nf_conntrack_extend.h:__nf_ct_ext_find
   Cyclomatic Complexity 1 include/net/netfilter/nf_conntrack_ecache.h:nf_ct_ecache_ext_add
   Cyclomatic Complexity 1 include/net/netfilter/nf_conntrack_ecache.h:nf_conntrack_eventmask_report
   Cyclomatic Complexity 1 include/net/netfilter/nf_conntrack_helper.h:nfct_help
   Cyclomatic Complexity 1 include/net/netfilter/nf_conntrack_seqadj.h:nfct_seqadj
   Cyclomatic Complexity 1 include/net/netfilter/nf_conntrack_acct.h:nf_conn_acct_find
   Cyclomatic Complexity 1 include/net/netfilter/nf_conntrack_timestamp.h:nf_conn_tstamp_find
   Cyclomatic Complexity 1 include/net/netfilter/nf_conntrack_timestamp.h:nf_ct_tstamp_ext_add
   Cyclomatic Complexity 1 include/net/netfilter/nf_conntrack_labels.h:nf_ct_labels_ext_add
   Cyclomatic Complexity 1 include/net/netfilter/nf_conntrack_synproxy.h:nfct_synproxy
   Cyclomatic Complexity 1 include/net/netfilter/nf_conntrack_synproxy.h:nfct_synproxy_ext_add
   Cyclomatic Complexity 1 include/linux/netfilter/nfnetlink.h:nfnl_msg_type
   Cyclomatic Complexity 1 net/netfilter/nf_conntrack_netlink.c:ctnetlink_attach_labels
   Cyclomatic Complexity 1 net/netfilter/nf_conntrack_netlink.c:expect_iter_all
   Cyclomatic Complexity 1 net/netfilter/nf_conntrack_netlink.c:ctnetlink_net_init
   Cyclomatic Complexity 1 net/netfilter/nf_conntrack_netlink.c:ctnetlink_net_exit
   Cyclomatic Complexity 2 net/netfilter/nf_conntrack_netlink.c:ctnetlink_net_exit_batch
   Cyclomatic Complexity 2 include/asm-generic/bitops-instrumented.h:test_bit

vim +/if +516 net/netfilter/nf_conntrack_netlink.c

   508	
   509	/* all these functions access ct->ext. Caller must either hold a reference
   510	 * on ct or prevent its deletion by holding either the bucket spinlock or
   511	 * pcpu dying list lock.
   512	 */
   513	static int ctnetlink_dump_extinfo(struct sk_buff *skb,
   514					  const struct nf_conn *ct, u32 type)
   515	{
 > 516		if (ctnetlink_dump_acct(skb, ct, type) < 0 ||
   517		    ctnetlink_dump_timestamp(skb, ct) < 0 ||
   518		    ctnetlink_dump_helpinfo(skb, ct) < 0 ||
   519		    ctnetlink_dump_labels(skb, ct) < 0 ||
   520		    ctnetlink_dump_ct_seq_adj(skb, ct) < 0 ||
   521		    ctnetlink_dump_ct_synproxy(skb, ct) < 0)
   522			return -1;
   523	
   524		return 0;
   525	}
   526	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Netfitler Users]     [Berkeley Packet Filter]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux