Re: [PATCH net 1/2] tcp: re-enable acceptance of FIN packets when RWIN is 0

From: Kuniyuki Iwashima

Date: Sun Feb 22 2026 - 20:36:56 EST


On Sun, Feb 22, 2026 at 4:35 AM Simon Baatz via B4 Relay
<devnull+gmbnomis.gmail.com@xxxxxxxxxx> wrote:
>
> From: Simon Baatz <gmbnomis@xxxxxxxxx>
>
> 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@xxxxxxxxx>

Good catch, thanks !

Reviewed-by: Kuniyuki Iwashima <kuniyu@xxxxxxxxxx>