[openssh-commits] [openssh] 01/02: upstream: don't sigdie() in signal handler in privsep child process;

git+noreply at mindrot.org git+noreply at mindrot.org
Mon May 10 10:58:30 AEST 2021


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

djm pushed a commit to branch master
in repository openssh.

commit e3c032333be5fdbbaf2751f6f478e044922b4ec4
Author: djm at openbsd.org <djm at openbsd.org>
Date:   Fri May 7 03:09:38 2021 +0000

    upstream: don't sigdie() in signal handler in privsep child process;
    
    this can end up causing sandbox violations per bz3286; ok dtucker@
    
    OpenBSD-Commit-ID: a7f40b2141dca4287920da68ede812bff7ccfdda
---
 sshd.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/sshd.c b/sshd.c
index 5aa04d05..88497f5f 100644
--- a/sshd.c
+++ b/sshd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sshd.c,v 1.572 2021/04/03 06:18:41 djm Exp $ */
+/* $OpenBSD: sshd.c,v 1.573 2021/05/07 03:09:38 djm Exp $ */
 /*
  * Author: Tatu Ylonen <ylo at cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo at cs.hut.fi>, Espoo, Finland
@@ -366,11 +366,14 @@ grace_alarm_handler(int sig)
 		kill(0, SIGTERM);
 	}
 
-	/* XXX pre-format ipaddr/port so we don't need to access active_state */
 	/* Log error and exit. */
-	sigdie("Timeout before authentication for %s port %d",
-	    ssh_remote_ipaddr(the_active_state),
-	    ssh_remote_port(the_active_state));
+	if (use_privsep && pmonitor != NULL && pmonitor->m_pid <= 0)
+		cleanup_exit(255); /* don't log in privsep child */
+	else {
+		sigdie("Timeout before authentication for %s port %d",
+		    ssh_remote_ipaddr(the_active_state),
+		    ssh_remote_port(the_active_state));
+	}
 }
 
 /* Destroy the host and server keys.  They will no longer be needed. */

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


More information about the openssh-commits mailing list