From 094c686142ff2308c5c8c69b40e115c19b7f66d6 Mon Sep 17 00:00:00 2001 From: John Safranek Date: Mon, 18 May 2026 16:59:32 -0700 Subject: [PATCH] wolfsshd: retry select() on EINTR in relay loop SIGCHLD from the exec child interrupts select(), returning -1 and breaking the loop. Any windowFull data awaiting a peer window adjust was then abandoned, causing intermittent 32 KB truncations on large exec transfers. Continue on EINTR. --- apps/wolfsshd/wolfsshd.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/apps/wolfsshd/wolfsshd.c b/apps/wolfsshd/wolfsshd.c index fe0f7419..e08cb42d 100644 --- a/apps/wolfsshd/wolfsshd.c +++ b/apps/wolfsshd/wolfsshd.c @@ -1543,8 +1543,14 @@ static int SHELL_Subsystem(WOLFSSHD_CONNECTION* conn, WOLFSSH* ssh, } rc = select((int)maxFd + 1, &readFds, &writeFds, NULL, NULL); - if (rc == -1) + if (rc == -1) { + /* Signal (e.g. SIGCHLD from child exit) interrupted select. + * Re-evaluate the loop condition so any pending windowFull + * data and remaining pipe contents still get drained. */ + if (errno == EINTR) + continue; break; + } } else { pending = 1; /* found some pending SSH data */