* [PATCH nf-next] netfilter: nf_conntrack_tcp: skip tracking for offloaded packets
@ 2022-03-18 14:49 Pablo Neira Ayuso
2022-03-18 15:17 ` Florian Westphal
0 siblings, 1 reply; 2+ messages in thread
From: Pablo Neira Ayuso @ 2022-03-18 14:49 UTC (permalink / raw)
To: netfilter-devel; +Cc: fw
Sometimes flowtable datapath passes up packets to classic forwarding
path, eg. mtu exceeded case. Skip TCP tracking otherwise these packets
are considered invalid by conntrack.
Fixes: ac2a66665e23 ("netfilter: add generic flow table infrastructure")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
This is a fix, but I'm routing it through nf-next at this stage.
net/netfilter/nf_conntrack_proto_tcp.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/net/netfilter/nf_conntrack_proto_tcp.c b/net/netfilter/nf_conntrack_proto_tcp.c
index d1582b888c0d..e0a1f86910ec 100644
--- a/net/netfilter/nf_conntrack_proto_tcp.c
+++ b/net/netfilter/nf_conntrack_proto_tcp.c
@@ -889,6 +889,9 @@ int nf_conntrack_tcp_packet(struct nf_conn *ct,
if (!nf_ct_is_confirmed(ct) && !tcp_new(ct, skb, dataoff, th))
return -NF_ACCEPT;
+ if (unlikely(test_bit(IPS_OFFLOAD_BIT, &ct->status)))
+ return NF_ACCEPT;
+
spin_lock_bh(&ct->lock);
old_state = ct->proto.tcp.state;
dir = CTINFO2DIR(ctinfo);
--
2.30.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH nf-next] netfilter: nf_conntrack_tcp: skip tracking for offloaded packets
2022-03-18 14:49 [PATCH nf-next] netfilter: nf_conntrack_tcp: skip tracking for offloaded packets Pablo Neira Ayuso
@ 2022-03-18 15:17 ` Florian Westphal
0 siblings, 0 replies; 2+ messages in thread
From: Florian Westphal @ 2022-03-18 15:17 UTC (permalink / raw)
To: Pablo Neira Ayuso; +Cc: netfilter-devel, fw
Pablo Neira Ayuso <pablo@netfilter.org> wrote:
> Sometimes flowtable datapath passes up packets to classic forwarding
> path, eg. mtu exceeded case. Skip TCP tracking otherwise these packets
> are considered invalid by conntrack.
They are? nft_flow_offload_eval() sets IP_CT_TCP_FLAG_BE_LIBERAL for
the conntrack, so at least window checks are disabled.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-03-18 15:17 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-18 14:49 [PATCH nf-next] netfilter: nf_conntrack_tcp: skip tracking for offloaded packets Pablo Neira Ayuso
2022-03-18 15:17 ` 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).