]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
netfilter: nf_flow_table: fix offload for flows that are subject to xfrm
authorFlorian Westphal <fw@strlen.de>
Tue, 30 Jul 2019 12:57:19 +0000 (14:57 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 10 Sep 2019 09:35:11 +0000 (10:35 +0100)
commit701b89908ba1cf65929dee667a982b325fc2d372
treebd01ce871d28222f8fe88c19562842068677dc40
parentb8a132a4c4b6e97c8f157623167c8d5a5b75c1ab
netfilter: nf_flow_table: fix offload for flows that are subject to xfrm

[ Upstream commit 589b474a4b7ce409d6821ef17234a995841bd131 ]

This makes the previously added 'encap test' pass.
Because its possible that the xfrm dst entry becomes stale while such
a flow is offloaded, we need to call dst_check() -- the notifier that
handles this for non-tunneled traffic isn't sufficient, because SA or
or policies might have changed.

If dst becomes stale the flow offload entry will be tagged for teardown
and packets will be passed to 'classic' forwarding path.

Removing the entry right away is problematic, as this would
introduce a race condition with the gc worker.

In case flow is long-lived, it could eventually be offloaded again
once the gc worker removes the entry from the flow table.

Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/netfilter/nf_flow_table_ip.c