netfilter: nf_conntrack_tcp: preserve liberal flag in tcp options
authorPablo Neira Ayuso <pablo@netfilter.org>
Mon, 21 Mar 2022 10:38:32 +0000 (11:38 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Apr 2022 07:08:21 +0000 (09:08 +0200)
commit6923164d2efad8ad25404d01012d63baf3c45b10
treeeb054ad5c82106c6e8f7fce481715ac7d37a4ef7
parentc73c5c5632978cd3c52169090770833bb0a7ccea
netfilter: nf_conntrack_tcp: preserve liberal flag in tcp options

[ Upstream commit f2dd495a8d589371289981d5ed33e6873df94ecc ]

Do not reset IP_CT_TCP_FLAG_BE_LIBERAL flag in out-of-sync scenarios
coming before the TCP window tracking, otherwise such connections will
fail in the window check.

Update tcp_options() to leave this flag in place and add a new helper
function to reset the tcp window state.

Based on patch from Sven Auhagen.

Fixes: c4832c7bbc3f ("netfilter: nf_ct_tcp: improve out-of-sync situation in TCP tracking")
Tested-by: Sven Auhagen <sven.auhagen@voleatech.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/netfilter/nf_conntrack_proto_tcp.c