diff options
author | djm@openbsd.org <djm@openbsd.org> | 2024-07-26 00:40:08 +0200 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2024-07-26 00:51:40 +0200 |
commit | 29fb6f6d46b67770084b4f12bcf8a01bd535041b (patch) | |
tree | 0a46a2b18f8386e3483b5ded512c6e8abd08c28d /channels.c | |
parent | upstream: mention mux proxy mode (diff) | |
download | openssh-29fb6f6d46b67770084b4f12bcf8a01bd535041b.tar.xz openssh-29fb6f6d46b67770084b4f12bcf8a01bd535041b.zip |
upstream: Fix proxy multiplexing (-O proxy) bug
If a mux started with ControlPersist then later has a forwarding added using
mux proxy connection and the forwarding was used, then when the mux proxy
session terminates, the mux master process will send a channel close to the
server with a bad channel ID and crash the connection.
This was caused by my stupidly reusing c->remote_id for mux channel
associations when I should have just added another member to struct channel.
ok markus@
OpenBSD-Commit-ID: c9f474e0124e3fe456c5e43749b97d75e65b82b2
Diffstat (limited to 'channels.c')
-rw-r--r-- | channels.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/channels.c b/channels.c index 3ee694717..a23fde425 100644 --- a/channels.c +++ b/channels.c @@ -1,4 +1,4 @@ -/* $OpenBSD: channels.c,v 1.438 2024/05/17 00:30:23 djm Exp $ */ +/* $OpenBSD: channels.c,v 1.439 2024/07/25 22:40:08 djm Exp $ */ /* * Author: Tatu Ylonen <ylo@cs.hut.fi> * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland @@ -1016,14 +1016,16 @@ channel_format_status(const Channel *c) { char *ret = NULL; - xasprintf(&ret, "t%d [%s] %s%u i%u/%zu o%u/%zu e[%s]/%zu " - "fd %d/%d/%d sock %d cc %d io 0x%02x/0x%02x", + xasprintf(&ret, "t%d [%s] %s%u %s%u i%u/%zu o%u/%zu e[%s]/%zu " + "fd %d/%d/%d sock %d cc %d %s%u io 0x%02x/0x%02x", c->type, c->xctype != NULL ? c->xctype : c->ctype, c->have_remote_id ? "r" : "nr", c->remote_id, + c->mux_ctx != NULL ? "m" : "nm", c->mux_downstream_id, c->istate, sshbuf_len(c->input), c->ostate, sshbuf_len(c->output), channel_format_extended_usage(c), sshbuf_len(c->extended), c->rfd, c->wfd, c->efd, c->sock, c->ctl_chan, + c->have_ctl_child_id ? "c" : "nc", c->ctl_child_id, c->io_want, c->io_ready); return ret; } |