https://bugzilla.mindrot.org/show_bug.cgi?id=4065

Kron Kastrati <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]

--- Comment #2 from Kron Kastrati <[email protected]> ---
I tested both patches on Ubuntu 24.04 with master and the github PR
#746
branch built side by side: sshd in a network namespace behind a veth
pair with 40 ms netem delay, an ssh -w tunnel to it, and
"iperf3 -u -b 2G -l 1300" for 60 s through the tunnel to keep the
channel window full.

  master:   2584 x "rcvd too much data" on the server, 142 Mbit/s
  patched:     0 x "rcvd too much data",               143 Mbit/s

Neither run disconnected: local_window_exceeded is paid back from
local_consumed in channel_check_window(), so steady drift stays under
the 10% grace limit, and it takes a burst or a latency spike to cross
it, which matches the reported 30-40 s disconnects under real traffic.

History, for context: the receiver-side "win_len += 4" came from
7d4571894 (2010, "Fix a trio of bugs in the local/remote window
calculation for datagram data channels"). The sender was not changed
then and has subtracted only the payload since. The same commit moved
the local_consumed credit from before the write() to the "out:" label
but kept the early "return 1" on EAGAIN/EINTR, which is the leak the
second patch fixes.

Interop: receivers credit data_len + 4 in every version I checked
(before 2010 via "local_consumed += dlen + 4"), so a sender that
subtracts plen + 4 gets exactly that back from old and new peers.

The new "plen + 4 > remote_maxpacket" check also stops a datagram
within 4 bytes of the peer's maxpacket from being sent and then
dropped by channel_input_data() without being credited.

GitHub review with the same details:
https://github.com/openssh/openssh-portable/pull/746

-- 
You are receiving this mail because:
You are watching the assignee of the bug.
_______________________________________________
openssh-bugs mailing list
[email protected]
https://lists.mindrot.org/mailman/listinfo/openssh-bugs

Reply via email to