]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
upstream: check for EINTR/EAGAIN failures in the rfd fast-path; caught
authordjm@openbsd.org <djm@openbsd.org>
Thu, 17 Feb 2022 10:58:27 +0000 (10:58 +0000)
committerDamien Miller <djm@mindrot.org>
Thu, 17 Feb 2022 11:17:36 +0000 (22:17 +1100)
by dtucker's minix3 vm :) ok dtucker@

OpenBSD-Commit-ID: 2e2c895a3e82ef347aa6694394a76a438be91361

channels.c

index d662ff03aea0a6d38318cf24a7f7d5926007ed76..73e93c032765e2694bd6e6ad3ad51d23a621a3a8 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: channels.c,v 1.412 2022/01/22 00:45:31 djm Exp $ */
+/* $OpenBSD: channels.c,v 1.413 2022/02/17 10:58:27 djm Exp $ */
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1951,6 +1951,9 @@ channel_handle_rfd(struct ssh *ssh, Channel *c)
                if (maxlen > avail)
                        maxlen = avail;
                if ((r = sshbuf_read(c->rfd, c->input, maxlen, NULL)) != 0) {
+                       if (errno == EINTR || (!force &&
+                           (errno == EAGAIN || errno == EWOULDBLOCK)))
+                               return 1;
                        debug2("channel %d: read failed rfd %d maxlen %zu: %s",
                            c->self, c->rfd, maxlen, ssh_err(r));
                        goto rfail;