]> www.infradead.org Git - users/dwmw2/linux.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 10 Sep 2019 09:35:13 +0000 (10:35 +0100)
commitea3c243ce799eefc93a81f866f941e34a156d5c3
treea3dc329d03caaf8450fe10ad5c2c17d4f8348ff0
parent96a517d0ba5f6251e0602047348f1a073f2044c1
netfilter: nf_flow_table: teardown flow timeout race

[ Upstream commit 1e5b2471bcc4838df298080ae1ec042c2cbc9ce9 ]

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: da5984e51063 ("netfilter: nf_flow_table: add support for sending flows back to the slow path")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/netfilter/nf_flow_table_core.c