Bug 1503 - Possible Intermittent False-negative on Port Forwarding.
Summary: Possible Intermittent False-negative on Port Forwarding.
Status: CLOSED WORKSFORME
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: ssh (show other bugs)
Version: 5.0p1
Hardware: Other Other
: P2 minor
Assignee: Assigned to nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-08-12 03:21 AEST by Tom Hanson
Modified: 2011-01-24 12:33 AEDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tom Hanson 2008-08-12 03:21:58 AEST
While debugging other issues I have seen occasional reports of "Remote port forwarding failed..."  At least some of them appear to be incorrect because forwarding was actually working.

Investigation revealed a probable cause:  SSH2_MSG_GLOBAL_REQUEST packets are being used for 2 purposes.  They are used to request/cancel port forwarding AND they are used as "keep alive" messages.  Problem is, the server ( server_input_global_request() ) sets type to FAILURE for any packet other than "tcpip-forward" or "cancel-tcpip-forward".  Thus, "keep alive" requests are always set to FAILURE.  When received by the Client, it can not differentiate a "keep alive" response from a forwarding request response.  If timing is such that a keep alive was sent just prior to a forwarding request, the keep-alive response may be read by the forwarding code as a failure.

2 notes:
1) I have not been able to reproduce this and document the packet traffic.
2) It appears that the server is expecting one of [SSH2_MSG_CHANNEL_FAILURE, SSH2_MSG_REQUEST_SUCCESS, SSH2_MSG_REQUEST_FAILURE ] as a keep alive message BUT the client _appears_ to be sending SSH2_MSG_GLOBAL_REQUEST in order to trigger a [SSH2_MSG_REQUEST_FAILURE |SSH2_MSG_REQUEST_SUCCESS] response which the client wants as a keep-alive.  Combining this pattern with packet_read_poll_seqnr() resetting "keep_alive_timeouts" for every packet, regardless of type, suggests that the keep-alive hand-shaking scheme may be broken.
Comment 1 Damien Miller 2008-08-13 23:36:11 AEST
Could you please try to replicate this with openssh-5.1? It properly matches channel success/failures to callback functions.
Comment 2 Damien Miller 2010-04-26 20:13:31 AEST
no reply for 18 months and the bug is almost certainly fixed in a more recent release.
Comment 3 Damien Miller 2011-01-24 12:33:48 AEDT
Move resolved bugs to CLOSED after 5.7 release