Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] mptcp: option builder clobbers tp->rcv_wnd, skewing zero-window
  MIB counters
--

commit 742bf9afd917e0f6220a2af28f73dd7a4e8d66d5
Author: Paolo Abeni <[email protected]>

ms/mptcp: allow subflow rcv wnd to shrink

When the subflow sends a DSS ACK, mptcp_established_options_dss() now resets 
tp->rcv_wnd to rcv_nxt - rcv_wup. This lets the TCP-level receive window shrink 
even when the netns setting would not allow it.

Link: 
https://patch.msgid.link/20260602-net-mptcp-misc-fixes-7-1-rc7-v2-4-856831229...@kernel.org

> diff --git a/net/mptcp/options.c b/net/mptcp/options.c
> index 51978cf24f23..51cb4ed3f7ce 100644
> --- a/net/mptcp/options.c
> +++ b/net/mptcp/options.c
[ ... ]
> @@ -621,6 +622,12 @@ static bool mptcp_established_options_dss(struct sock 
> *sk, struct sk_buff *skb,
>       if (dss_size == 0)
>               ack_size += TCPOLEN_MPTCP_DSS_BASE;
>  
> +     /* The caller is __tcp_transmit_skb(), and will compute the new rcv
> +      * wnd soon: ensure that the window can shrink.
> +      */
> +     if (skb)
> +             tp->rcv_wnd = tp->rcv_nxt - tp->rcv_wup;
> +
>       dss_size += ack_size;

[Severity: Low]
Does overwriting tp->rcv_wnd here skew the zero-window MIB counters?

tcp_select_window() runs after this and does "u32 old_win = tp->rcv_wnd".
So old_win is now the amount of data received since the last window update, not 
the previously advertised window. When rcv_nxt == rcv_wup, old_win is 0.

tcp_select_window() uses old_win for LINUX_MIB_TCPTOZEROWINDOWADV and 
LINUX_MIB_TCPFROMZEROWINDOWADV. In that case TCPFROMZEROWINDOWADV can be 
incremented spuriously on any ACK that advertises a non-zero window. A real 
transition to a zero window can be missed by TCPTOZEROWINDOWADV, because the 
"if (old_win)" test fails.

The window on the wire is not affected, only the SNMP counters. The commit 
message does not mention this side effect. Could the real old_win be saved, or 
passed to tcp_select_window() through an MPTCP hook, so the counters stay 
accurate?

-- 
Sashiko AI review ยท 
https://sashiko.vzint.dev/#/patchset/[email protected]?part=6

_______________________________________________
Devel mailing list
[email protected]
https://lists.openvz.org/mailman/listinfo/devel

Reply via email to