sshd unhandled SIGALRM

Andrew Gaul andrew at gaul.org
Thu Jan 25 18:04:32 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.345
diff -u -r1.345 sshd.c
--- sshd.c	24 Jul 2006 04:51:01 -0000	1.345
+++ sshd.c	3 Aug 2006 06:13:53 -0000
@@ -291,6 +291,7 @@
 	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