sshd unhandled SIGALRM (resend)

Andrew Gaul andrew at gaul.org
Wed Feb 21 17:45:44 EST 2007


sshd will die from an unhandled SIGALRM if you allow SSH1 connections,        
ssh in, HUP sshd, and don't ssh in again for KeyRegenerationInterval.         
The HUP handler calls exec which resets signal handlers but persists          
alarm timers.  Chapter and verse:                                             
                                                                              
    http://www.opengroup.org/onlinepubs/000095399/functions/alarm.html

-- 
Andrew Gaul
http://gaul.org/
-------------- next part --------------
Index: sshd.c
===================================================================
RCS file: /cvs/openssh/sshd.c,v
retrieving revision 1.361
diff -u -p -r1.361 sshd.c
--- sshd.c	7 Nov 2006 12:14:42 -0000	1.361
+++ sshd.c	21 Feb 2007 06:37:18 -0000
@@ -305,6 +305,7 @@ sighup_restart(void)
 	logit("Received SIGHUP; restarting.");
 	close_listen_socks();
 	close_startup_pipes();
+	alarm(0);  /* alarm timer persists across exec */
 	execv(saved_argv[0], saved_argv);
 	logit("RESTART FAILED: av[0]='%.100s', error: %.100s.", saved_argv[0],
 	    strerror(errno));


More information about the openssh-unix-dev mailing list