[Bug 2756] sshd does not seem to terminate despite ClientAlive[Interval|CountMax] when a process is polling a remote forwarding channel

bugzilla-daemon at bugzilla.mindrot.org bugzilla-daemon at bugzilla.mindrot.org
Thu Aug 10 16:27:12 AEST 2017


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

Darren Tucker <dtucker at zip.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Attachment #3029|0                           |1
        is obsolete|                            |
                 CC|                            |djm at mindrot.org
   Attachment #3030|                            |ok?(djm at mindrot.org)
              Flags|                            |

--- Comment #5 from Darren Tucker <dtucker at zip.com.au> ---
Created attachment 3030
  --> https://bugzilla.mindrot.org/attachment.cgi?id=3030&action=edit
keep track of the last time we heard from the client and trigger
client_alive_check()

I came up with the following to reproduce:

1) make sure you've got an inetd with the discard service enabled.
2) sshd -o ClientAliveInterval=3 -o ClientAliveCountMax=3 -p 2022
3) ssh -p 2022 -R 1234:localhost:9 localhost
4) while sleep 1; do echo foo; done | nc localhost 1234
5) pkill -STOP -u $USER -x ssh

-current does indeed hang.  I found that my first patch kills the
connection too early because once the last_client_time check fires
it'll fire again immediately, so last_client_time needs to be reset
when that happens.  With that it works more or less as expected.

I'm not super concerned about the potential timing inaccuracy you
mention as we're looking at redoing the select code to use something
that allows a bit more flexibility and is easier to reason about.

-- 
You are receiving this mail because:
You are watching the assignee of the bug.
You are watching someone on the CC list of the bug.


More information about the openssh-bugs mailing list