OpenSSH
[Top] [All Lists]

sshd Termination by SIGALRM

To: openssh-unix-dev@mindrot.org
Subject: sshd Termination by SIGALRM
From: spatil <spatil@sonoasystems.com>
Date: Tue, 06 Mar 2007 19:07:02 +0530
Delivered-to: sp-com-lists@consult.net
Delivered-to: openssh-unix-dev-list1@securepoint.com
Delivered-to: openssh-unix-dev-tmda@mindrot.org
Delivered-to: tmda@mindrot.org
List-archive: <http://lists.mindrot.org/pipermail/openssh-unix-dev>
List-help: <mailto:openssh-unix-dev-request@mindrot.org?subject=help>
List-id: Development of portable OpenSSH <openssh-unix-dev.mindrot.org>
List-post: <mailto:openssh-unix-dev@mindrot.org>
List-subscribe: <http://lists.mindrot.org/mailman/listinfo/openssh-unix-dev>, <mailto:openssh-unix-dev-request@mindrot.org?subject=subscribe>
List-unsubscribe: <http://lists.mindrot.org/mailman/listinfo/openssh-unix-dev>, <mailto:openssh-unix-dev-request@mindrot.org?subject=unsubscribe>
Old-delivered-to: openssh-unix-dev@mindrot.org
Sender: openssh-unix-dev-bounces+openssh-unix-dev-list1=securepoint.com@mindrot.org
User-agent: Thunderbird 1.5.0.10 (X11/20070221)
Hi,
     I am seeing a problem where in sshd gets terminated by SIGALRM. 
sshd was listening on the socket and was not restarted.
I saw a recent bug fix in openBSD openssh CVS which mentions:

        Clear alarm() before restarting sshd on SIGHUP.  Without this, if 
there's
        a SIGALRM pending (for SSH1 key regeneration) when sshd is SIGHUP'ed, 
the
        newly exec'ed sshd will get the SIGALRM and not have a handler for it,
        and the default action will terminate the listening sshd.  Analysis and
        patch from andrew at gaul.org.

In my case no such signal was received.

I am using OpenSSH 3.8.1p1 on FC3 with linux-2.6.16.13 kernel. The 
signal system call in Linux might fail
if there is any pending signal for the process. It returns 
ERESTARTNOINTR. The following code in openssh
sshd.c:main():

                /* Mark that the key has been used (it was "given" to 
the child). */
                if ((options.protocol & SSH_PROTO_1) &&
                    key_used == 0) {
                    /* Schedule server key regeneration alarm. */
                    signal(SIGALRM, key_regeneration_alarm);
                    alarm(options.key_regeneration_time);
                    key_used = 1;
                }
might cause a problem if signal call fails because of the above stated 
reason. In such a case the default handler (SIG_DFL which is terminate)
gets called since alarm function gets executed anyways.

Is my analysis correct ?
_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev@mindrot.org
http://lists.mindrot.org/mailman/listinfo/openssh-unix-dev

<Prev in Thread] Current Thread [Next in Thread>
  • sshd Termination by SIGALRM, spatil <=