]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
upstream: Continue accept loop when pselect
authordtucker@openbsd.org <dtucker@openbsd.org>
Thu, 10 Jun 2021 03:14:14 +0000 (03:14 +0000)
committerDarren Tucker <dtucker@dtucker.net>
Thu, 10 Jun 2021 09:48:53 +0000 (19:48 +1000)
returns -1, eg if it was interrupted by a signal.  This should prevent
the hang discovered by sthen@ wherein sshd receives a SIGHUP while it has
an unauthenticated child and goes on to a blocking read on a notify_pipe.
feedback deraadt@, ok djm@

OpenBSD-Commit-ID: 0243c1c5544fca0974dae92cd4079543a3fceaa0

sshd.c

diff --git a/sshd.c b/sshd.c
index 7e80b174907ef8cdf34c7c62507fb5f752036c76..6d645c4ab6aedff306336161db604670b6bc19e8 100644 (file)
--- a/sshd.c
+++ b/sshd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sshd.c,v 1.575 2021/06/06 11:34:16 djm Exp $ */
+/* $OpenBSD: sshd.c,v 1.576 2021/06/10 03:14:14 dtucker Exp $ */
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1213,7 +1213,7 @@ server_accept_loop(int *sock_in, int *sock_out, int *newsock, int *config_s)
                if (ret == -1 && errno != EINTR)
                        error("pselect: %.100s", strerror(errno));
                sigprocmask(SIG_SETMASK, &osigset, NULL);
-               if (received_sigterm)
+               if (ret == -1)
                        continue;
 
                for (i = 0; i < options.max_startups; i++) {