mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: net/netfilter/nf_conntrack_proto.c:181:35: sparse: sparse: incorrect type in assignment (different modifiers)
Date: Tue, 22 Sep 2026 23:45:45 +0800	[thread overview]
Message-ID: <202609222347.fomKeXBU-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   f0100363d8c374bd8e9ea7c9ba02744f0b802ca4
commit: ac46f3f35b6e68fb062ae7cf780d516c0cf4c00a netfilter: nf_conntrack_helper: add refcounting from datapath
date:   4 months ago
config: um-randconfig-r1307-20260922 (https://download.01.org/0day-ci/archive/20260922/202609222347.fomKeXBU-lkp@intel.com/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/20260922/202609222347.fomKeXBU-lkp@intel.com/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 <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202609222347.fomKeXBU-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
>> net/netfilter/nf_conntrack_proto.c:181:35: sparse: sparse: incorrect type in assignment (different modifiers) @@     expected int ( *helper_cb )( ... ) @@     got int ( [noderef] * )( ... ) @@
   net/netfilter/nf_conntrack_proto.c:181:35: sparse:     expected int ( *helper_cb )( ... )
   net/netfilter/nf_conntrack_proto.c:181:35: sparse:     got int ( [noderef] * )( ... )

vim +181 net/netfilter/nf_conntrack_proto.c

   127	
   128	unsigned int nf_confirm(void *priv,
   129				struct sk_buff *skb,
   130				const struct nf_hook_state *state)
   131	{
   132		int (*helper_cb)(struct sk_buff *skb, unsigned int protoff,
   133				 struct nf_conn *ct,
   134				 enum ip_conntrack_info conntrackinfo);
   135		const struct nf_conn_help *help;
   136		enum ip_conntrack_info ctinfo;
   137		unsigned int protoff;
   138		struct nf_conn *ct;
   139		bool seqadj_needed;
   140		__be16 frag_off;
   141		int start;
   142		u8 pnum;
   143	
   144		ct = nf_ct_get(skb, &ctinfo);
   145		if (!ct || in_vrf_postrouting(state))
   146			return NF_ACCEPT;
   147	
   148		help = nfct_help(ct);
   149	
   150		seqadj_needed = test_bit(IPS_SEQ_ADJUST_BIT, &ct->status) && !nf_is_loopback_packet(skb);
   151		if (!help && !seqadj_needed)
   152			return nf_conntrack_confirm(skb);
   153	
   154		/* helper->help() do not expect ICMP packets */
   155		if (ctinfo == IP_CT_RELATED_REPLY)
   156			return nf_conntrack_confirm(skb);
   157	
   158		switch (nf_ct_l3num(ct)) {
   159		case NFPROTO_IPV4:
   160			protoff = skb_network_offset(skb) + ip_hdrlen(skb);
   161			break;
   162		case NFPROTO_IPV6:
   163			pnum = ipv6_hdr(skb)->nexthdr;
   164			start = ipv6_skip_exthdr(skb, sizeof(struct ipv6hdr), &pnum, &frag_off);
   165			if (start < 0 || (frag_off & htons(~0x7)) != 0)
   166				return nf_conntrack_confirm(skb);
   167	
   168			protoff = start;
   169			break;
   170		default:
   171			return nf_conntrack_confirm(skb);
   172		}
   173	
   174		if (help) {
   175			const struct nf_conntrack_helper *helper;
   176			int ret;
   177	
   178			/* rcu_read_lock()ed by nf_hook */
   179			helper = rcu_dereference(help->helper);
   180			if (helper) {
 > 181				helper_cb = rcu_dereference(helper->help);
   182				if (helper_cb) {
   183					ret = helper_cb(skb, protoff,
   184							ct, ctinfo);
   185					if (ret != NF_ACCEPT)
   186						return ret;
   187				}
   188			}
   189		}
   190	
   191		if (seqadj_needed &&
   192		    !nf_ct_seq_adjust(skb, ct, ctinfo, protoff)) {
   193			NF_CT_STAT_INC_ATOMIC(nf_ct_net(ct), drop);
   194			return NF_DROP;
   195		}
   196	
   197		/* We've seen it coming out the other side: confirm it */
   198		return nf_conntrack_confirm(skb);
   199	}
   200	EXPORT_SYMBOL_GPL(nf_confirm);
   201	

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

                 reply	other threads:[~2026-09-22 15:46 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202609222347.fomKeXBU-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=pablo@netfilter.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®