net/netfilter/nf_conntrack_ovs.c:66:19: sparse: sparse: incorrect type in assignment (different modifiers)
kernel test robot <[email protected]>
| Newsgroups | dev.linux.lists.oe-kbuild-all,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <[email protected]> |
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: fce2dfa773ced15f27dd27cd0b482a7473cdcf2a commit: ac46f3f35b6e68fb062ae7cf780d516c0cf4c00a netfilter: nf_conntrack_helper: add refcounting from datapath date: 6 weeks ago config: x86_64-randconfig-r134-20260717 (https://download.01.org/0day-ci/archive/20260717/[email protected]/config) compiler: gcc-14 (Debian 14.2.0-19) 14.2.0 sparse: v0.6.5-rc1 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260717/[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 | Fixes: ac46f3f35b6e ("netfilter: nf_conntrack_helper: add refcounting from datapath") | 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_conntrack_ovs.c:66:19: sparse: sparse: incorrect type in assignment (different modifiers) @@ expected int ( *helper_cb )( ... ) @@ got int ( [noderef] * )( ... ) @@ net/netfilter/nf_conntrack_ovs.c:66:19: sparse: expected int ( *helper_cb )( ... ) net/netfilter/nf_conntrack_ovs.c:66:19: sparse: got int ( [noderef] * )( ... ) vim +66 net/netfilter/nf_conntrack_ovs.c 10 11 /* 'skb' should already be pulled to nh_ofs. */ 12 int nf_ct_helper(struct sk_buff *skb, struct nf_conn *ct, 13 enum ip_conntrack_info ctinfo, u16 proto) 14 { 15 int (*helper_cb)(struct sk_buff *skb, unsigned int protoff, 16 struct nf_conn *ct, 17 enum ip_conntrack_info conntrackinfo); 18 const struct nf_conntrack_helper *helper; 19 const struct nf_conn_help *help; 20 unsigned int protoff; 21 int err; 22 23 if (ctinfo == IP_CT_RELATED_REPLY) 24 return NF_ACCEPT; 25 26 help = nfct_help(ct); 27 if (!help) 28 return NF_ACCEPT; 29 30 helper = rcu_dereference(help->helper); 31 if (!helper) 32 return NF_ACCEPT; 33 34 if (helper->tuple.src.l3num != NFPROTO_UNSPEC && 35 helper->tuple.src.l3num != proto) 36 return NF_ACCEPT; 37 38 switch (proto) { 39 case NFPROTO_IPV4: 40 protoff = ip_hdrlen(skb); 41 proto = ip_hdr(skb)->protocol; 42 break; 43 case NFPROTO_IPV6: { 44 u8 nexthdr = ipv6_hdr(skb)->nexthdr; 45 __be16 frag_off; 46 int ofs; 47 48 ofs = ipv6_skip_exthdr(skb, sizeof(struct ipv6hdr), &nexthdr, 49 &frag_off); 50 if (ofs < 0 || (frag_off & htons(~0x7)) != 0) { 51 pr_debug("proto header not found\n"); 52 return NF_ACCEPT; 53 } 54 protoff = ofs; 55 proto = nexthdr; 56 break; 57 } 58 default: 59 WARN_ONCE(1, "helper invoked on non-IP family!"); 60 return NF_DROP; 61 } 62 63 if (helper->tuple.dst.protonum != proto) 64 return NF_ACCEPT; 65 > 66 helper_cb = rcu_dereference(helper->help); 67 if (!helper_cb) 68 return NF_ACCEPT; 69 70 err = helper_cb(skb, protoff, ct, ctinfo); 71 if (err != NF_ACCEPT) 72 return err; 73 74 /* Adjust seqs after helper. This is needed due to some helpers (e.g., 75 * FTP with NAT) adusting the TCP payload size when mangling IP 76 * addresses and/or port numbers in the text-based control connection. 77 */ 78 if (test_bit(IPS_SEQ_ADJUST_BIT, &ct->status) && 79 !nf_ct_seq_adjust(skb, ct, ctinfo, protoff)) 80 return NF_DROP; 81 return NF_ACCEPT; 82 } 83 EXPORT_SYMBOL_GPL(nf_ct_helper); 84 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki