Uploaded image for project: 'MINA SSHD'
  1. MINA SSHD
  2. SSHD-848

Possible bug opening local port forwarding channel

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.1.0
    • 2.2.0
    • None

    Description

      Hi , We found a possible bug opening a local port forwarding channel.

      Scenario : The SSH client and server are based on Apache SSHD 2.0.1. There is a FTP client sending a file through a local port forwarding channel to a target server.

      The problem manifests when the SSH server is busy and returns the SSH_MSG_CHANNEL_OPEN_CONFIRMATION with a some delay and the client is very fast to send only a few bytes on a local port forwarding channel.

      The outcome is the FTP client is NOT able to send bytes through the channel to the target server.

      Into SSH client traces we see :

      org.apache.sshd.common.channel.WindowClosedException: Already closed: Window[client/remote](TcpipClientChannel[id=4, recipient=4]-ClientSessionImpl[roberto@/192.168.50.61:10022])

       

      According to us there is a chance that if we don't AWAIT the local port forward channel is TOTALLY opened, when the client is very fast to send bytes... it closes its connection, ao the channel that is already closing prevents bytes to flow through the channel to the target server.

       

      We guess there is a code bug in DefaultForwardingFilter.sessionCreated() method.

      We add the following line at the end of the method and the problem seems definitely fixed.

                  channel.getOpenFuture().await();

       

      Please, can you troubleshoot this issue and comment about our potential code fix ?

      Thanks in advance.

       

      I attached  the files:

      testslpf.ko SSH client traces with original code and a failed attempt

      testslpf.ok SSH client traces with our code changes and a successful attempt

       

      Attachments

        1. testlpf.ok
          41 kB
          Roberto Deandrea
        2. testlpf.ko
          22 kB
          Roberto Deandrea

        Issue Links

          Activity

            People

              Unassigned Unassigned
              roberto.deandrea Roberto Deandrea
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: