]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
netfilter: flowtable: GC pushes back packets to classic path
authorPablo Neira Ayuso <pablo@netfilter.org>
Tue, 24 Oct 2023 19:09:47 +0000 (21:09 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 10 Jan 2024 16:10:34 +0000 (17:10 +0100)
commit2bb4ecb3349c19a04e2219113b169646ca194608
tree814eb1b0f67942e5918d0d5daf641110f14dcfef
parentdf01de08b4118f19c87f23a72a0c4751b906d23b
netfilter: flowtable: GC pushes back packets to classic path

[ Upstream commit 735795f68b37e9bb49f642407a0d49b1631ea1c7 ]

Since 41f2c7c342d3 ("net/sched: act_ct: Fix promotion of offloaded
unreplied tuple"), flowtable GC pushes back flows with IPS_SEEN_REPLY
back to classic path in every run, ie. every second. This is because of
a new check for NF_FLOW_HW_ESTABLISHED which is specific of sched/act_ct.

In Netfilter's flowtable case, NF_FLOW_HW_ESTABLISHED never gets set on
and IPS_SEEN_REPLY is unreliable since users decide when to offload the
flow before, such bit might be set on at a later stage.

Fix it by adding a custom .gc handler that sched/act_ct can use to
deal with its NF_FLOW_HW_ESTABLISHED bit.

Fixes: 41f2c7c342d3 ("net/sched: act_ct: Fix promotion of offloaded unreplied tuple")
Reported-by: Vladimir Smelhaus <vl.sm@email.cz>
Reviewed-by: Paul Blakey <paulb@nvidia.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Stable-dep-of: 125f1c7f26ff ("net/sched: act_ct: Take per-cb reference to tcf_ct_flow_table")
Signed-off-by: Sasha Levin <sashal@kernel.org>
include/net/netfilter/nf_flow_table.h
net/netfilter/nf_flow_table_core.c
net/sched/act_ct.c