Re: [PATCH nf-next,v2 6/6] netfilter: flowtable: add CLOSING state

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

 



Hi Pablo,

kernel test robot noticed the following build warnings:

[auto build test WARNING on netfilter-nf/main]
[also build test WARNING on linus/master v6.13-rc6 next-20250108]
[cannot apply to nf-next/master]
[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/Pablo-Neira-Ayuso/netfilter-nft_flow_offload-update-tcp-state-flags-under-lock/20250108-075203
base:   https://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf.git main
patch link:    https://lore.kernel.org/r/20250107235038.115651-6-pablo%40netfilter.org
patch subject: [PATCH nf-next,v2 6/6] netfilter: flowtable: add CLOSING state
config: hexagon-allyesconfig (https://download.01.org/0day-ci/archive/20250109/202501091229.n0ldd7t2-lkp@xxxxxxxxx/config)
compiler: clang version 18.1.8 (https://github.com/llvm/llvm-project 3b5b5c1ec4a3095ab096dd780e84d7ab81f3d7ff)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250109/202501091229.n0ldd7t2-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/202501091229.n0ldd7t2-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

>> net/netfilter/nf_flow_table_core.c:217:13: warning: variable 'expired' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
     217 |         } else if (l4num == IPPROTO_UDP) {
         |                    ^~~~~~~~~~~~~~~~~~~~
   net/netfilter/nf_flow_table_core.c:229:6: note: uninitialized use occurs here
     229 |         if (expired)
         |             ^~~~~~~
   net/netfilter/nf_flow_table_core.c:217:9: note: remove the 'if' if its condition is always false
     217 |         } else if (l4num == IPPROTO_UDP) {
         |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~
     218 |                 const struct nf_udp_net *tn = nf_udp_pernet(net);
         |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     219 |                 enum udp_conntrack state =
         |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~
     220 |                         test_bit(IPS_SEEN_REPLY_BIT, &ct->status) ?
         |                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     221 |                         UDP_CT_REPLIED : UDP_CT_UNREPLIED;
         |                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     222 | 
     223 |                 timeout = READ_ONCE(tn->timeouts[state]);
         |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     224 |                 offload_timeout = READ_ONCE(tn->offload_timeout);
         |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     225 |         } else {
         |         ~~~~~~
   net/netfilter/nf_flow_table_core.c:194:14: note: initialize the variable 'expired' to silence this warning
     194 |         bool expired;
         |                     ^
         |                      = 0
   1 warning generated.


vim +217 net/netfilter/nf_flow_table_core.c

da5984e51063a2 Felix Fietkau     2018-02-26  187  
e622d94ec73f66 Pablo Neira Ayuso 2025-01-08  188  static void flow_offload_fixup_ct(struct flow_offload *flow)
da5984e51063a2 Felix Fietkau     2018-02-26  189  {
e622d94ec73f66 Pablo Neira Ayuso 2025-01-08  190  	struct nf_conn *ct = flow->ct;
1d91d2e1a7f767 Oz Shlomo         2021-06-03  191  	struct net *net = nf_ct_net(ct);
1e5b2471bcc483 Pablo Neira Ayuso 2019-08-09  192  	int l4num = nf_ct_protonum(ct);
e622d94ec73f66 Pablo Neira Ayuso 2025-01-08  193  	u32 offload_timeout = 0;
e622d94ec73f66 Pablo Neira Ayuso 2025-01-08  194  	bool expired;
4592ee7f525c46 Florian Westphal  2021-08-04  195  	s32 timeout;
da5984e51063a2 Felix Fietkau     2018-02-26  196  
1d91d2e1a7f767 Oz Shlomo         2021-06-03  197  	if (l4num == IPPROTO_TCP) {
e622d94ec73f66 Pablo Neira Ayuso 2025-01-08  198  		const struct nf_tcp_net *tn = nf_tcp_pernet(net);
e622d94ec73f66 Pablo Neira Ayuso 2025-01-08  199  		u8 tcp_state;
1d91d2e1a7f767 Oz Shlomo         2021-06-03  200  
e622d94ec73f66 Pablo Neira Ayuso 2025-01-08  201  		/* Enter CLOSE state if fin/rst packet has been seen, this
e622d94ec73f66 Pablo Neira Ayuso 2025-01-08  202  		 * allows TCP reopen from conntrack. Otherwise, pick up from
e622d94ec73f66 Pablo Neira Ayuso 2025-01-08  203  		 * the last seen TCP state.
e622d94ec73f66 Pablo Neira Ayuso 2025-01-08  204  		 */
e622d94ec73f66 Pablo Neira Ayuso 2025-01-08  205  		if (test_bit(NF_FLOW_CLOSING, &flow->flags)) {
e622d94ec73f66 Pablo Neira Ayuso 2025-01-08  206  			flow_offload_fixup_tcp(ct, TCP_CONNTRACK_CLOSE);
e622d94ec73f66 Pablo Neira Ayuso 2025-01-08  207  			timeout = READ_ONCE(tn->timeouts[TCP_CONNTRACK_CLOSE]);
e622d94ec73f66 Pablo Neira Ayuso 2025-01-08  208  			expired = false;
e622d94ec73f66 Pablo Neira Ayuso 2025-01-08  209  		} else {
e622d94ec73f66 Pablo Neira Ayuso 2025-01-08  210  			tcp_state = READ_ONCE(ct->proto.tcp.state);
e622d94ec73f66 Pablo Neira Ayuso 2025-01-08  211  			flow_offload_fixup_tcp(ct, tcp_state);
e622d94ec73f66 Pablo Neira Ayuso 2025-01-08  212  			timeout = READ_ONCE(tn->timeouts[tcp_state]);
e622d94ec73f66 Pablo Neira Ayuso 2025-01-08  213  			expired = nf_flow_has_expired(flow);
e622d94ec73f66 Pablo Neira Ayuso 2025-01-08  214  		}
e622d94ec73f66 Pablo Neira Ayuso 2025-01-08  215  		offload_timeout = READ_ONCE(tn->offload_timeout);
e5eaac2beb54f0 Pablo Neira Ayuso 2022-05-17  216  
1d91d2e1a7f767 Oz Shlomo         2021-06-03 @217  	} else if (l4num == IPPROTO_UDP) {
e622d94ec73f66 Pablo Neira Ayuso 2025-01-08  218  		const struct nf_udp_net *tn = nf_udp_pernet(net);
0eb5acb1641889 Vlad Buslov       2023-02-01  219  		enum udp_conntrack state =
0eb5acb1641889 Vlad Buslov       2023-02-01  220  			test_bit(IPS_SEEN_REPLY_BIT, &ct->status) ?
0eb5acb1641889 Vlad Buslov       2023-02-01  221  			UDP_CT_REPLIED : UDP_CT_UNREPLIED;
1d91d2e1a7f767 Oz Shlomo         2021-06-03  222  
e622d94ec73f66 Pablo Neira Ayuso 2025-01-08  223  		timeout = READ_ONCE(tn->timeouts[state]);
e622d94ec73f66 Pablo Neira Ayuso 2025-01-08  224  		offload_timeout = READ_ONCE(tn->offload_timeout);
1d91d2e1a7f767 Oz Shlomo         2021-06-03  225  	} else {
da5984e51063a2 Felix Fietkau     2018-02-26  226  		return;
1d91d2e1a7f767 Oz Shlomo         2021-06-03  227  	}
da5984e51063a2 Felix Fietkau     2018-02-26  228  
e622d94ec73f66 Pablo Neira Ayuso 2025-01-08  229  	if (expired)
e622d94ec73f66 Pablo Neira Ayuso 2025-01-08  230  		timeout -= offload_timeout;
e622d94ec73f66 Pablo Neira Ayuso 2025-01-08  231  
4592ee7f525c46 Florian Westphal  2021-08-04  232  	if (timeout < 0)
4592ee7f525c46 Florian Westphal  2021-08-04  233  		timeout = 0;
4592ee7f525c46 Florian Westphal  2021-08-04  234  
e622d94ec73f66 Pablo Neira Ayuso 2025-01-08  235  	nf_ct_refresh(ct, timeout);
da5984e51063a2 Felix Fietkau     2018-02-26  236  }
da5984e51063a2 Felix Fietkau     2018-02-26  237  

-- 
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