-
Notifications
You must be signed in to change notification settings - Fork 404
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ssh connection occasionally aborted by dropbear while establishing the connection (regression) #173
Comments
Thanks for the report. I think the problem might occur when If it's easy for you to currently reproduce, would you be able to try putting a call |
Hello mkj! Thanks for the response. Our automated test can reproduce the problem rather quickly.
Note that for the tests today, I removed the debug traces we previously added, so they don’t interfere. These traces tend to increase the occurrence of the issue. |
Ah yes, my theory doesn't make sense - I'd forgotten that the signal handler is no longer asynchronous (noticed some other things to clean up there too). I'm a bit puzzled why |
Deleted. |
Hello Matt. Thanks for the support. Your last comment helped us understand how the problem happens. We previously made a modification in srv_auth.c (function recv_msg_userauth_request()) where we fork a child process to perform user/password validation. This fork causes a call to sesssigchild_handler() (in srv-chansession.c) , which writes into ses.signal_pipe. This then causes session_loop() to set ses.channel_signal_pending to 1 before there is a pid in ChanSess.pid. The reason why this worked in the past is probably because the older versions of dropbear did not nave the « chansess->pid==0 » condition in the return() statement of sesscheckclose(). And the reason why it doesn’t fail all the time is because most of the time, there is nothing to read from ses.sock_in in the same loop iteration. I’m trying to find a way to deal with that. Do you have suggestions?
|
I close this issue. Thanks for the hints, this was very helpful |
We use dropbear on the server side, to create an ssh session with a command-line application.
An ssh client connects to it. Sometimes the connection fails.
We repeat the connection sequence a large number of times in an automated test.
The problem started after upgrading from 2018-76 to 2022-82. We believe that the regression appeared in 2022-82 because it seems related to issue #85 (https://github.com/mkj/dropbear/pull/85/files)
We found the failure mechanism, as well as two potential fixes
Failure mechanism :
Potential fixes :
The text was updated successfully, but these errors were encountered: