Re: [PATCH nf-next 1/2] netfilter: nf_conntrack: don't rely on implicit includes

kernel test robot <[email protected]>
Newsgroups org.kernel.vger.audit,dev.linux.lists.bridge,dev.linux.lists.oe-kbuild-all,org.kernel.vger.netfilter-devel
Message-ID <[email protected]>
Hi Florian,

kernel test robot noticed the following build errors:

[auto build test ERROR on netfilter-nf/main]
[also build test ERROR on pcmoore-audit/next next-20260108]
[cannot apply to nf-next/master linus/master v6.16-rc1]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Florian-Westphal/netfilter-nf_conntrack-don-t-rely-on-implicit-includes/20260108-012311
base:   https://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf.git main
patch link:    https://lore.kernel.org/r/20260107152548.31769-2-fw%40strlen.de
patch subject: [PATCH nf-next 1/2] netfilter: nf_conntrack: don't rely on implicit includes
config: x86_64-rhel-9.4-bpf (https://download.01.org/0day-ci/archive/20260108/[email protected]/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260108/[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]/

All errors (new ones prefixed by >>):

   net/netfilter/nf_conntrack_bpf.c: In function 'bpf_skb_ct_alloc':
>> net/netfilter/nf_conntrack_bpf.c:367:46: error: implicit declaration of function 'sock_net'; did you mean 'check_net'? [-Wimplicit-function-declaration]
     367 |         net = skb->dev ? dev_net(skb->dev) : sock_net(skb->sk);
         |                                              ^~~~~~~~
         |                                              check_net
>> net/netfilter/nf_conntrack_bpf.c:367:44: error: pointer/integer type mismatch in conditional expression [-Wint-conversion]
     367 |         net = skb->dev ? dev_net(skb->dev) : sock_net(skb->sk);
         |                                            ^
   net/netfilter/nf_conntrack_bpf.c: In function 'bpf_skb_ct_lookup':
   net/netfilter/nf_conntrack_bpf.c:402:51: error: pointer/integer type mismatch in conditional expression [-Wint-conversion]
     402 |         caller_net = skb->dev ? dev_net(skb->dev) : sock_net(skb->sk);
         |                                                   ^


vim +367 net/netfilter/nf_conntrack_bpf.c

b4c2b9593a1c4c Kumar Kartikeya Dwivedi 2022-01-14  343  
d7e79c97c00ca8 Lorenzo Bianconi        2022-07-21  344  /* bpf_skb_ct_alloc - Allocate a new CT entry
d7e79c97c00ca8 Lorenzo Bianconi        2022-07-21  345   *
d7e79c97c00ca8 Lorenzo Bianconi        2022-07-21  346   * Parameters:
d7e79c97c00ca8 Lorenzo Bianconi        2022-07-21  347   * @skb_ctx	- Pointer to ctx (__sk_buff) in TC program
d7e79c97c00ca8 Lorenzo Bianconi        2022-07-21  348   *		    Cannot be NULL
d7e79c97c00ca8 Lorenzo Bianconi        2022-07-21  349   * @bpf_tuple	- Pointer to memory representing the tuple to look up
d7e79c97c00ca8 Lorenzo Bianconi        2022-07-21  350   *		    Cannot be NULL
d7e79c97c00ca8 Lorenzo Bianconi        2022-07-21  351   * @tuple__sz	- Length of the tuple structure
d7e79c97c00ca8 Lorenzo Bianconi        2022-07-21  352   *		    Must be one of sizeof(bpf_tuple->ipv4) or
d7e79c97c00ca8 Lorenzo Bianconi        2022-07-21  353   *		    sizeof(bpf_tuple->ipv6)
d7e79c97c00ca8 Lorenzo Bianconi        2022-07-21  354   * @opts	- Additional options for allocation (documented above)
d7e79c97c00ca8 Lorenzo Bianconi        2022-07-21  355   *		    Cannot be NULL
d7e79c97c00ca8 Lorenzo Bianconi        2022-07-21  356   * @opts__sz	- Length of the bpf_ct_opts structure
ece4b296904167 Brad Cowie              2024-05-22  357   *		    Must be NF_BPF_CT_OPTS_SZ (16) or 12
d7e79c97c00ca8 Lorenzo Bianconi        2022-07-21  358   */
400031e05adfce David Vernet            2023-02-01  359  __bpf_kfunc struct nf_conn___init *
d7e79c97c00ca8 Lorenzo Bianconi        2022-07-21  360  bpf_skb_ct_alloc(struct __sk_buff *skb_ctx, struct bpf_sock_tuple *bpf_tuple,
d7e79c97c00ca8 Lorenzo Bianconi        2022-07-21  361  		 u32 tuple__sz, struct bpf_ct_opts *opts, u32 opts__sz)
d7e79c97c00ca8 Lorenzo Bianconi        2022-07-21  362  {
d7e79c97c00ca8 Lorenzo Bianconi        2022-07-21  363  	struct sk_buff *skb = (struct sk_buff *)skb_ctx;
d7e79c97c00ca8 Lorenzo Bianconi        2022-07-21  364  	struct nf_conn *nfct;
d7e79c97c00ca8 Lorenzo Bianconi        2022-07-21  365  	struct net *net;
d7e79c97c00ca8 Lorenzo Bianconi        2022-07-21  366  
d7e79c97c00ca8 Lorenzo Bianconi        2022-07-21 @367  	net = skb->dev ? dev_net(skb->dev) : sock_net(skb->sk);
d7e79c97c00ca8 Lorenzo Bianconi        2022-07-21  368  	nfct = __bpf_nf_ct_alloc_entry(net, bpf_tuple, tuple__sz, opts, opts__sz, 10);
d7e79c97c00ca8 Lorenzo Bianconi        2022-07-21  369  	if (IS_ERR(nfct)) {
d7e79c97c00ca8 Lorenzo Bianconi        2022-07-21  370  		if (opts)
d7e79c97c00ca8 Lorenzo Bianconi        2022-07-21  371  			opts->error = PTR_ERR(nfct);
d7e79c97c00ca8 Lorenzo Bianconi        2022-07-21  372  		return NULL;
d7e79c97c00ca8 Lorenzo Bianconi        2022-07-21  373  	}
d7e79c97c00ca8 Lorenzo Bianconi        2022-07-21  374  
d7e79c97c00ca8 Lorenzo Bianconi        2022-07-21  375  	return (struct nf_conn___init *)nfct;
d7e79c97c00ca8 Lorenzo Bianconi        2022-07-21  376  }
d7e79c97c00ca8 Lorenzo Bianconi        2022-07-21  377  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.