netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH nf] netfilter: nf_conntrack: Add allow_clash to generic protocol handler
@ 2025-12-19 11:53 Yuto Hamaguchi
  2025-12-20 20:05 ` Florian Westphal
  0 siblings, 1 reply; 4+ messages in thread
From: Yuto Hamaguchi @ 2025-12-19 11:53 UTC (permalink / raw)
  To: pablo, kadlec, netfilter-devel; +Cc: coreteam, netdev, Hamaguchi.Yuto

The upstream commit, 71d8c47fc653711c41bc3282e5b0e605b3727956
 ("netfilter: conntrack: introduce clash resolution on insertion race"),
sets allow_clash=true in the UDP/UDPLITE protocol handler
but does not set it in the generic protocol handler.

As a result, packets composed of connectionless protocols at each layer,
such as UDP over IP-in-IP, still drop packets due to conflicts during conntrack insertion.

To resolve this, this patch sets allow_clash in the nf_conntrack_l4proto_generic.

Signed-off-by: Yuto Hamaguchi <Hamaguchi.Yuto@da.MitsubishiElectric.co.jp>
---
 net/netfilter/nf_conntrack_proto_generic.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/netfilter/nf_conntrack_proto_generic.c b/net/netfilter/nf_conntrack_proto_generic.c
index e831637bc8ca..cb260eb3d012 100644
--- a/net/netfilter/nf_conntrack_proto_generic.c
+++ b/net/netfilter/nf_conntrack_proto_generic.c
@@ -67,6 +67,7 @@ void nf_conntrack_generic_init_net(struct net *net)
 const struct nf_conntrack_l4proto nf_conntrack_l4proto_generic =
 {
 	.l4proto		= 255,
+	.allow_clash            = true,
 #ifdef CONFIG_NF_CONNTRACK_TIMEOUT
 	.ctnl_timeout		= {
 		.nlattr_to_obj	= generic_timeout_nlattr_to_obj,
-- 
2.36.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH nf] netfilter: nf_conntrack: Add allow_clash to generic protocol handler
  2025-12-19 11:53 [PATCH nf] netfilter: nf_conntrack: Add allow_clash to generic protocol handler Yuto Hamaguchi
@ 2025-12-20 20:05 ` Florian Westphal
  2025-12-22 10:32   ` Pablo Neira Ayuso
  0 siblings, 1 reply; 4+ messages in thread
From: Florian Westphal @ 2025-12-20 20:05 UTC (permalink / raw)
  To: Yuto Hamaguchi; +Cc: pablo, kadlec, netfilter-devel, coreteam, netdev

Yuto Hamaguchi <Hamaguchi.Yuto@da.MitsubishiElectric.co.jp> wrote:
> The upstream commit, 71d8c47fc653711c41bc3282e5b0e605b3727956
>  ("netfilter: conntrack: introduce clash resolution on insertion race"),
> sets allow_clash=true in the UDP/UDPLITE protocol handler
> but does not set it in the generic protocol handler.
> 
> As a result, packets composed of connectionless protocols at each layer,
> such as UDP over IP-in-IP, still drop packets due to conflicts during conntrack insertion.
> 
> To resolve this, this patch sets allow_clash in the nf_conntrack_l4proto_generic.

Makes sense to me, thanks.
I'll apply this for the next batch.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH nf] netfilter: nf_conntrack: Add allow_clash to generic protocol handler
  2025-12-20 20:05 ` Florian Westphal
@ 2025-12-22 10:32   ` Pablo Neira Ayuso
  2025-12-22 11:22     ` Florian Westphal
  0 siblings, 1 reply; 4+ messages in thread
From: Pablo Neira Ayuso @ 2025-12-22 10:32 UTC (permalink / raw)
  To: Florian Westphal
  Cc: Yuto Hamaguchi, kadlec, netfilter-devel, coreteam, netdev

On Sat, Dec 20, 2025 at 09:05:59PM +0100, Florian Westphal wrote:
> Yuto Hamaguchi <Hamaguchi.Yuto@da.MitsubishiElectric.co.jp> wrote:
> > The upstream commit, 71d8c47fc653711c41bc3282e5b0e605b3727956
> >  ("netfilter: conntrack: introduce clash resolution on insertion race"),
> > sets allow_clash=true in the UDP/UDPLITE protocol handler
> > but does not set it in the generic protocol handler.
> > 
> > As a result, packets composed of connectionless protocols at each layer,
> > such as UDP over IP-in-IP, still drop packets due to conflicts during conntrack insertion.
> > 
> > To resolve this, this patch sets allow_clash in the nf_conntrack_l4proto_generic.
> 
> Makes sense to me, thanks.

Would it be possible to follow a more conservative approach?
ie. restrict this to protocols where we know clashes are possible
such as IPIP.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH nf] netfilter: nf_conntrack: Add allow_clash to generic protocol handler
  2025-12-22 10:32   ` Pablo Neira Ayuso
@ 2025-12-22 11:22     ` Florian Westphal
  0 siblings, 0 replies; 4+ messages in thread
From: Florian Westphal @ 2025-12-22 11:22 UTC (permalink / raw)
  To: Pablo Neira Ayuso
  Cc: Yuto Hamaguchi, kadlec, netfilter-devel, coreteam, netdev

Pablo Neira Ayuso <pablo@netfilter.org> wrote:
> On Sat, Dec 20, 2025 at 09:05:59PM +0100, Florian Westphal wrote:
> > Yuto Hamaguchi <Hamaguchi.Yuto@da.MitsubishiElectric.co.jp> wrote:
> > > The upstream commit, 71d8c47fc653711c41bc3282e5b0e605b3727956
> > >  ("netfilter: conntrack: introduce clash resolution on insertion race"),
> > > sets allow_clash=true in the UDP/UDPLITE protocol handler
> > > but does not set it in the generic protocol handler.
> > > 
> > > As a result, packets composed of connectionless protocols at each layer,
> > > such as UDP over IP-in-IP, still drop packets due to conflicts during conntrack insertion.
> > > 
> > > To resolve this, this patch sets allow_clash in the nf_conntrack_l4proto_generic.
> > 
> > Makes sense to me, thanks.
> 
> Would it be possible to follow a more conservative approach?
> ie. restrict this to protocols where we know clashes are possible
> such as IPIP.

I don't think there is a need to be more conservative here.

If we have to fallback to the generic tracker that means we don't have a
L4 aware tracker for the protocol, so we can always merge entries instead
of dropping them.

Whats the concern?

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-12-22 11:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-19 11:53 [PATCH nf] netfilter: nf_conntrack: Add allow_clash to generic protocol handler Yuto Hamaguchi
2025-12-20 20:05 ` Florian Westphal
2025-12-22 10:32   ` Pablo Neira Ayuso
2025-12-22 11:22     ` Florian Westphal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).