[openssh-commits] [openssh] 07/13: upstream: run mux channels during KEX so closures are promptly

git+noreply at mindrot.org git+noreply at mindrot.org
Fri Nov 27 08:18:23 AEDT 2026


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

djm pushed a commit to branch master
in repository openssh.

commit 9bf51f6475319e5f6d5ef122316c7e68c36fdf3d
Author: djm at openbsd.org <djm at openbsd.org>
AuthorDate: Thu Nov 26 19:50:53 2026 +0000

    upstream: run mux channels during KEX so closures are promptly
    
    noted
    
    Anthropic ANT-2026-YK33945J
    
    OpenBSD-Commit-ID: 662955b6bd422a6489fc36e5975c2b9ec91019a3
---
 channels.c | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)

diff --git a/channels.c b/channels.c
index 44997bdcd..69fe4d9c8 100644
--- a/channels.c
+++ b/channels.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: channels.c,v 1.483 2026/11/26 03:44:28 djm Exp $ */
+/* $OpenBSD: channels.c,v 1.484 2026/11/26 19:50:53 djm Exp $ */
 /*
  * Author: Tatu Ylonen <ylo at cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo at cs.hut.fi>, Espoo, Finland
@@ -2817,6 +2817,19 @@ channel_garbage_collect(struct ssh *ssh, Channel *c)
 
 enum channel_table { CHAN_PRE, CHAN_POST };
 
+static int
+channel_can_enqueue_during_rekey(struct ssh *ssh, const Channel *c)
+{
+	if (!ssh_packet_can_enqueue(ssh))
+		return 0;
+	/* Mux channels must continue to run so their exits can be noted. */
+	if (c->type == SSH_CHANNEL_OPEN ||
+	    c->type == SSH_CHANNEL_MUX_CLIENT ||
+	    c->type == SSH_CHANNEL_MUX_LISTENER)
+		return 1;
+	return 0;
+}
+
 static void
 channel_handler(struct ssh *ssh, int table, struct timespec *timeout)
 {
@@ -2839,8 +2852,7 @@ channel_handler(struct ssh *ssh, int table, struct timespec *timeout)
 		 * the packet queue reaches its soft limit.
 		 */
 		if (ssh_packet_is_rekeying(ssh) &&
-		    (c->type != SSH_CHANNEL_OPEN ||
-		    !ssh_packet_can_enqueue(ssh)))
+		    !channel_can_enqueue_during_rekey(ssh, c))
 			continue;
 		if (c->delayed) {
 			if (table == CHAN_PRE)

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


More information about the openssh-commits mailing list