[openssh-commits] [openssh] 41/87: upstream: fix ChannelTimeout for PermitTunnel forwardings. These

git+noreply at mindrot.org git+noreply at mindrot.org
Fri Oct 30 20:21:18 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 c0ea89627a245c568448db06e968c870d70488ff
Author: djm at openbsd.org <djm at openbsd.org>
AuthorDate: Fri Oct 30 04:25:21 2026 +0000

    upstream: fix ChannelTimeout for PermitTunnel forwardings. These
    
    were not being applied because 1) the server used an unexpected name to label
    the channel and 2) the "last used" time was never set for these channels and
    this would cause the timeout never to fire.
    
    Anthropic ANT-2026-SF9IN6I4
    
    OpenBSD-Commit-ID: 8f3ba8416d5e514166666c5e02aa486c070bc0ea
---
 channels.c   | 5 ++++-
 serverloop.c | 4 ++--
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/channels.c b/channels.c
index b0770290f..66a1274ad 100644
--- a/channels.c
+++ b/channels.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: channels.c,v 1.474 2026/10/30 02:59:36 djm Exp $ */
+/* $OpenBSD: channels.c,v 1.475 2026/10/30 04:25:21 djm Exp $ */
 /*
  * Author: Tatu Ylonen <ylo at cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo at cs.hut.fi>, Espoo, Finland
@@ -601,6 +601,9 @@ channel_new(struct ssh *ssh, char *ctype, int type, int rfd, int wfd, int efd,
 	c->ctl_chan = -1;
 	c->delayed = 1;		/* prevent call to channel_post handler */
 	c->inactive_deadline = lookup_timeout(ssh, c->ctype);
+	/* channels created already open need a last used time for timeouts */
+	if (type == SSH_CHANNEL_OPEN)
+		channel_set_used_time(ssh, c);
 	TAILQ_INIT(&c->status_confirms);
 	channel_classify(ssh, c);
 	debug("channel %d: new %s [%s] (inactive timeout: %f)",
diff --git a/serverloop.c b/serverloop.c
index 9d8a3429e..f47f92597 100644
--- a/serverloop.c
+++ b/serverloop.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: serverloop.c,v 1.248 2026/07/14 01:05:05 djm Exp $ */
+/* $OpenBSD: serverloop.c,v 1.249 2026/10/30 04:25:21 djm Exp $ */
 /*
  * Author: Tatu Ylonen <ylo at cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo at cs.hut.fi>, Espoo, Finland
@@ -547,7 +547,7 @@ server_request_tun(struct ssh *ssh)
 		goto done;
 	debug("Tunnel forwarding using interface %s", ifname);
 
-	c = channel_new(ssh, "tun", SSH_CHANNEL_OPEN, sock, sock, -1,
+	c = channel_new(ssh, "tun-connection", SSH_CHANNEL_OPEN, sock, sock, -1,
 	    CHAN_TCP_WINDOW_DEFAULT, CHAN_TCP_PACKET_DEFAULT, 0, "tun", 1);
 	c->datagram = 1;
 #if defined(SSH_TUN_FILTER)

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


More information about the openssh-commits mailing list