]> git.ipfire.org Git - thirdparty/linux.git/commit
tcp: re-enable acceptance of FIN packets when RWIN is 0
authorSimon Baatz <gmbnomis@gmail.com>
Tue, 24 Feb 2026 08:20:12 +0000 (09:20 +0100)
committerJakub Kicinski <kuba@kernel.org>
Thu, 26 Feb 2026 03:07:02 +0000 (19:07 -0800)
commit1e3bb184e94125bae7c1703472109a646d0f79d9
treec2526d724e3a136b248aec3316dc8aadf68cd710
parent5cc619583c7e735c4fb801bede671fb6f9c79425
tcp: re-enable acceptance of FIN packets when RWIN is 0

Commit 2bd99aef1b19 ("tcp: accept bare FIN packets under memory
pressure") allowed accepting FIN packets in tcp_data_queue() even when
the receive window was closed, to prevent ACK/FIN loops with broken
clients.

Such a FIN packet is in sequence, but because the FIN consumes a
sequence number, it extends beyond the window. Before commit
9ca48d616ed7 ("tcp: do not accept packets beyond window"),
tcp_sequence() only required the seq to be within the window. After
that change, the entire packet (including the FIN) must fit within the
window. As a result, such FIN packets are now dropped and the handling
path is no longer reached.

Be more lenient by not counting the sequence number consumed by the
FIN when calling tcp_sequence(), restoring the previous behavior for
cases where only the FIN extends beyond the window.

Fixes: 9ca48d616ed7 ("tcp: do not accept packets beyond window")
Signed-off-by: Simon Baatz <gmbnomis@gmail.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>
Link: https://patch.msgid.link/20260224-fix_zero_wnd_fin-v2-1-a16677ea7cea@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/ipv4/tcp_input.c