Re: [PATCH] netfilter: Make xt_cgroup independent from net_cls

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

 



Hi Michal,

kernel test robot noticed the following build errors:

[auto build test ERROR on dd83757f6e686a2188997cb58b5975f744bb7786]

url:    https://github.com/intel-lab-lkp/linux/commits/Michal-Koutn/netfilter-Make-xt_cgroup-independent-from-net_cls/20250301-005409
base:   dd83757f6e686a2188997cb58b5975f744bb7786
patch link:    https://lore.kernel.org/r/20250228165216.339407-1-mkoutny%40suse.com
patch subject: [PATCH] netfilter: Make xt_cgroup independent from net_cls
config: arm-omap2plus_defconfig (https://download.01.org/0day-ci/archive/20250304/202503041133.n9Zlxnda-lkp@xxxxxxxxx/config)
compiler: arm-linux-gnueabi-gcc (GCC) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250304/202503041133.n9Zlxnda-lkp@xxxxxxxxx/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 <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202503041133.n9Zlxnda-lkp@xxxxxxxxx/

All errors (new ones prefixed by >>):

   net/netfilter/xt_cgroup.c: In function 'cgroup_mt_v0':
   net/netfilter/xt_cgroup.c:132:29: error: implicit declaration of function 'sock_cgroup_classid' [-Wimplicit-function-declaration]
     132 |         return (info->id == sock_cgroup_classid(&skb->sk->sk_cgrp_data)) ^
         |                             ^~~~~~~~~~~~~~~~~~~
   net/netfilter/xt_cgroup.c: In function 'cgroup_mt_v1':
   net/netfilter/xt_cgroup.c:147:45: error: implicit declaration of function 'sock_cgroup_ptr'; did you mean 'obj_cgroup_put'? [-Wimplicit-function-declaration]
     147 |                 return cgroup_is_descendant(sock_cgroup_ptr(skcd), ancestor) ^
         |                                             ^~~~~~~~~~~~~~~
         |                                             obj_cgroup_put
>> net/netfilter/xt_cgroup.c:147:45: error: passing argument 1 of 'cgroup_is_descendant' makes pointer from integer without a cast [-Wint-conversion]
     147 |                 return cgroup_is_descendant(sock_cgroup_ptr(skcd), ancestor) ^
         |                                             ^~~~~~~~~~~~~~~~~~~~~
         |                                             |
         |                                             int
   In file included from include/net/netprio_cgroup.h:11,
                    from include/linux/netdevice.h:42,
                    from include/linux/netfilter/x_tables.h:6,
                    from net/netfilter/xt_cgroup.c:16:
   include/linux/cgroup.h:511:56: note: expected 'struct cgroup *' but argument is of type 'int'
     511 | static inline bool cgroup_is_descendant(struct cgroup *cgrp,
         |                                         ~~~~~~~~~~~~~~~^~~~
   net/netfilter/xt_cgroup.c: In function 'cgroup_mt_v2':
   net/netfilter/xt_cgroup.c:165:45: error: passing argument 1 of 'cgroup_is_descendant' makes pointer from integer without a cast [-Wint-conversion]
     165 |                 return cgroup_is_descendant(sock_cgroup_ptr(skcd), ancestor) ^
         |                                             ^~~~~~~~~~~~~~~~~~~~~
         |                                             |
         |                                             int
   include/linux/cgroup.h:511:56: note: expected 'struct cgroup *' but argument is of type 'int'
     511 | static inline bool cgroup_is_descendant(struct cgroup *cgrp,
         |                                         ~~~~~~~~~~~~~~~^~~~


vim +/cgroup_is_descendant +147 net/netfilter/xt_cgroup.c

82a37132f300ea Daniel Borkmann 2013-12-29  135  
c38c4597e4bf3e Tejun Heo       2015-12-07  136  static bool cgroup_mt_v1(const struct sk_buff *skb, struct xt_action_param *par)
c38c4597e4bf3e Tejun Heo       2015-12-07  137  {
c38c4597e4bf3e Tejun Heo       2015-12-07  138  	const struct xt_cgroup_info_v1 *info = par->matchinfo;
c38c4597e4bf3e Tejun Heo       2015-12-07  139  	struct sock_cgroup_data *skcd = &skb->sk->sk_cgrp_data;
c38c4597e4bf3e Tejun Heo       2015-12-07  140  	struct cgroup *ancestor = info->priv;
f564650106a6e8 Flavio Leitner  2018-06-27  141  	struct sock *sk = skb->sk;
c38c4597e4bf3e Tejun Heo       2015-12-07  142  
f564650106a6e8 Flavio Leitner  2018-06-27  143  	if (!sk || !sk_fullsock(sk) || !net_eq(xt_net(par), sock_net(sk)))
c38c4597e4bf3e Tejun Heo       2015-12-07  144  		return false;
c38c4597e4bf3e Tejun Heo       2015-12-07  145  
c38c4597e4bf3e Tejun Heo       2015-12-07  146  	if (ancestor)
c38c4597e4bf3e Tejun Heo       2015-12-07 @147  		return cgroup_is_descendant(sock_cgroup_ptr(skcd), ancestor) ^
c38c4597e4bf3e Tejun Heo       2015-12-07  148  			info->invert_path;
c38c4597e4bf3e Tejun Heo       2015-12-07  149  	else
c38c4597e4bf3e Tejun Heo       2015-12-07  150  		return (info->classid == sock_cgroup_classid(skcd)) ^
c38c4597e4bf3e Tejun Heo       2015-12-07  151  			info->invert_classid;
c38c4597e4bf3e Tejun Heo       2015-12-07  152  }
c38c4597e4bf3e Tejun Heo       2015-12-07  153  

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




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

  Powered by Linux