Erlang Mailing Lists

Author Message

<  Erlang patches mailing list  ~  yet another ssh bug

klacke
Posted: Fri Dec 28, 2007 2:03 pm Reply with quote
User Joined: 28 Feb 2005 Posts: 138
This fatso bug is also triggered by the putty 0.60 client

Whenever recv_msg() returns an actual error, we loop
indefinitely. Tcp_closed is never received, since it is already
received when we were in passive mode.

It basically means that all all OTP ssh systems out there
that expose ssh outwards can be easily brought out of
service simply by trying to connect with putty 0.60 to them
and then exit putty.



Index: ssh_transport.erl
===================================================================
--- ssh_transport.erl (revision 14365)
+++ ssh_transport.erl (working copy)
@@ -733,9 +733,17 @@
inet:setopts(S, [{active, once}]),
ssh_main(S, User, SSH);
{error, _Other} ->
- inet:setopts(S, [{active, once}]),
- %% send disconnect!
- ssh_main(S, User, SSH)
+ %% socket may or may not be closed, regardless
+ %% we close again
+ %% discon msg may be sent.
+ User ! {
+ ssh_msg, self(),
+ #ssh_msg_disconnect {
+ code=?SSH_DISCONNECT_CONNECTION_LOST,
+ description = "Connection closed",
+ language = "" }},
+ gen_tcp:close(S),
+ ok
end;



/klacke


_______________________________________________
erlang-patches mailing list
erlang-patches@erlang.org
http://www.erlang.org/mailman/listinfo/erlang-patches
Post recived from mailinglist
View user's profile Send private message AIM Address MSN Messenger
Guest
Posted: Wed Jan 09, 2008 8:59 am Reply with quote
Guest
Well, we can not have it this way now can we Wink Thank you for the patch.
We will fix this.

Regards Ingela -OTP team


Claes Wikstrom wrote:
> This fatso bug is also triggered by the putty 0.60 client
>
> Whenever recv_msg() returns an actual error, we loop
> indefinitely. Tcp_closed is never received, since it is already
> received when we were in passive mode.
>
> It basically means that all all OTP ssh systems out there
> that expose ssh outwards can be easily brought out of
> service simply by trying to connect with putty 0.60 to them
> and then exit putty.
>
>
>
> Index: ssh_transport.erl
> ===================================================================
> --- ssh_transport.erl (revision 14365)
> +++ ssh_transport.erl (working copy)
> @@ -733,9 +733,17 @@
> inet:setopts(S, [{active, once}]),
> ssh_main(S, User, SSH);
> {error, _Other} ->
> - inet:setopts(S, [{active, once}]),
> - %% send disconnect!
> - ssh_main(S, User, SSH)
> + %% socket may or may not be closed, regardless
> + %% we close again
> + %% discon msg may be sent.
> + User ! {
> + ssh_msg, self(),
> + #ssh_msg_disconnect {
> + code=?SSH_DISCONNECT_CONNECTION_LOST,
> + description = "Connection closed",
> + language = "" }},
> + gen_tcp:close(S),
> + ok
> end;
>
>
>
> /klacke
>
>
> _______________________________________________
> erlang-patches mailing list
> erlang-patches@erlang.org
> http://www.erlang.org/mailman/listinfo/erlang-patches
>
>

_______________________________________________
erlang-patches mailing list
erlang-patches@erlang.org
http://www.erlang.org/mailman/listinfo/erlang-patches
Post recived from mailinglist

Display posts from previous:  

All times are GMT
Page 1 of 1
This forum is locked: you cannot post, reply to, or edit topics.

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum