[openssh-commits] [openssh] 08/18: upstream: fix LoginGraceTime bypass if sshd is started in inetd

git+noreply at mindrot.org git+noreply at mindrot.org
Wed Nov 25 19:56:03 AEDT 2026


This is an automated email from the git hooks/post-receive script.

djm pushed a commit to branch master
in repository openssh.

commit a2c31a7d58143b77039f8918db5dd178f14e0a0f
Author: djm at openbsd.org <djm at openbsd.org>
AuthorDate: Wed Nov 25 07:18:36 2026 +0000

    upstream: fix LoginGraceTime bypass if sshd is started in inetd
    
    mode and by a parent process that does not make sshd the leader of its own
    process group (e.g. socat or tcpserver, but not inetd, xinetd or systemd)
    
    Anthropic ANT-2026-9BLEML5H
    
    OpenBSD-Commit-ID: ed3fa329b93abbd927234621de1353d8a1170cff
---
 sshd-session.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/sshd-session.c b/sshd-session.c
index 0e4c1b309..3847ffcab 100644
--- a/sshd-session.c
+++ b/sshd-session.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sshd-session.c,v 1.26 2026/09/16 00:13:58 djm Exp $ */
+/* $OpenBSD: sshd-session.c,v 1.27 2026/11/25 07:18:36 djm Exp $ */
 /*
  * SSH2 implementation:
  * Privilege Separation:
@@ -219,6 +219,15 @@ grace_alarm_handler(int sig)
 #endif
 		(void)sigaction(SIGTERM, &sa, NULL);
 		kill(0, SIGTERM);
+	} else if (privsep_is_preauth && pmonitor != NULL &&
+	    pmonitor->m_pid > 1) {
+		/*
+		 * The process group signal above does not reach the privsep
+		 * child if we are not the group leader (e.g. started via
+		 * sshd -i by something that didn't setsid()), so kill it
+		 * explicitly by pid.
+		 */
+		kill(pmonitor->m_pid, SIGKILL);
 	}
 	_exit(EXIT_LOGIN_GRACE);
 }

-- 
To stop receiving notification emails like this one, please contact
djm at mindrot.org.


More information about the openssh-commits mailing list