[Bug 52] ssh hangs on exit

bugzilla-daemon at mindrot.org bugzilla-daemon at mindrot.org
Wed Feb 22 20:34:41 EST 2006


http://bugzilla.mindrot.org/show_bug.cgi?id=52


djm at mindrot.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Attachment #1075|                            |ok-
               Flag|                            |




------- Comment #19 from djm at mindrot.org  2006-02-22 20:34 -------
(From update of attachment 1075)
We won't be applying this patch because it wrong, and something we tried quite
a few years ago.

It is essentially the same as the old, broken hang-on-exit fix that I
mistakenly added around ~2.2.x except that it papers over the obvious dataloss
race by only chopping off the read fd when it is a tty. It will still lose data
on ttys.

The following is from a patched sshd, demonstrating the dataloss. The root of
this is a race condition: the SIGCHLD can arrive *before* the read pipe is
fully empty.

> [djm at baragon djm]$ (set -e ; while [ 1 ] ; do
>     ssh -qttp2222 linux-qemu "dd if=/dev/zero bs=256k count=1" |
>     wc -c ; done)
>   262142
>   262093
>   262096
>   262125
>   262096
>   260056
>   262116
>   262124
>   212974
> ^C[djm at baragon djm]$

I recommend that packegers of OpenSSH do *not* apply this patch.




------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.




More information about the openssh-bugs mailing list