From f6fa34da6526ec814bc8c66e7cf6ac490befd484 Mon Sep 17 00:00:00 2001 From: djm Date: Thu, 17 Feb 2022 10:58:27 +0000 Subject: [PATCH] check for EINTR/EAGAIN failures in the rfd fast-path; caught by dtucker's minix3 vm :) ok dtucker@ --- usr.bin/ssh/channels.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/usr.bin/ssh/channels.c b/usr.bin/ssh/channels.c index f5e5baebdfe..db9d5d9dfca 100644 --- a/usr.bin/ssh/channels.c +++ b/usr.bin/ssh/channels.c @@ -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 * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -1931,6 +1931,8 @@ 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 || errno == EAGAIN) + return 1; debug2("channel %d: read failed rfd %d maxlen %zu: %s", c->self, c->rfd, maxlen, ssh_err(r)); goto rfail; -- 2.20.1