Difference in buffer behaviour between 8.89 and 8.9?

Damien Miller djm at mindrot.org
Sat May 21 11:08:32 AEST 2022

On Fri, 20 May 2022, rapier wrote:

> > I don't understand the problem and I don't understand the fix, sorry.
> I don't really understand the problem either whcih means the fix really is a
> band aid at this point.
> > The sshbuf_read() in packet.c will always reserve PACKET_MAX_SIZE (256k)
> > in addition to whatever is in the buffer currently and will greedily try to
> > fill it (up to max_size).
> The problem is that I'm not seeing that behaviour. It's pretty easy to see
> though - just up the default window and drop that debug into sshbuf.c. It's
> easier to see if you ramp up the delay with netem but even with no delay it's
> there. Either way, I'm only seeing it ramp up by 32K at a time.

Are you sure that it's the packet receive buffer in this case?

I'd recommend instrumenting sshbuf_read() first and seeing what what it's
doing, e.g. how much data the read() is returning.

You can set SSHBUF_DEBUG at compile time to get a lot more info.
A strace or similar might be helpful too.


More information about the openssh-unix-dev mailing list