]> git.baikalelectronics.ru Git - kernel.git/commit
netfilter: nf_flow_table: teardown flow timeout race
authorPablo Neira Ayuso <pablo@netfilter.org>
Fri, 9 Aug 2019 09:01:35 +0000 (11:01 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Fri, 9 Aug 2019 12:41:21 +0000 (14:41 +0200)
commit9152b7338a1d753c17f00cc4cc79edfedc899a0f
treeafb60cb11b763df36f19564e1d85e93ff7f3ee31
parent72f14d4768a9691f5af8d449eea4d383ec19beba
netfilter: nf_flow_table: teardown flow timeout race

Flows that are in teardown state (due to RST / FIN TCP packet) still
have their offload flag set on. Hence, the conntrack garbage collector
may race to undo the timeout adjustment that the fixup routine performs,
leaving the conntrack entry in place with the internal offload timeout
(one day).

Update teardown flow state to ESTABLISHED and set tracking to liberal,
then once the offload bit is cleared, adjust timeout if it is more than
the default fixup timeout (conntrack might already have set a lower
timeout from the packet path).

Fixes: 618e56ff4e73 ("netfilter: nf_flow_table: add support for sending flows back to the slow path")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nf_flow_table_core.c