[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#941443: openssh-client: Causes terminal corruption by disabling XON/XOFF unconditionally



Package: openssh-client
Version: 1:7.9p1-10
Severity: important

Hello,

I am using an original DEC vt420 serial terminal connected to a Debian
box.  As with many such terminals, it:

1) Is incapable of consistently processing incoming data, particularly
if it contains escape sequences, at line rate if the line rate is
above 4800bps (though it supports line rates up to 38400bps);

2) Supports only XON/XOFF flow control.

I observed issues that were clearly related to flow control with
sshing from it to other systems, although it was working fine
locally.  I narrowed it down to this code in
sshtty.c:enter_raw_mode():

        tio.c_iflag &= ~(ISTRIP | INLCR | IGNCR | ICRNL | IXON | IXANY | IXOFF);

in other words, it unconditionally disables XON/XOFF handling on the
local machine.

You might be asking at this point: well, couldn't the remote handle
it?  And the answer is no, for several reasons:

1) The internal buffer on this terminal is tiny, far less than even
the TCP packet size.  It is quite possible -- likely, even -- that a
large screen update already caused a packet to be transmitted from the
remote end that will overflow the local buffer.

2) The latency in processing could mean that the remote sends enough
text to overflow the terminal's buffer after the terminal sends XOFF.

Other people from around the internet also report this issue.  For
instance:

https://superuser.com/questions/1096862/ssh-and-xon-xoff-software-flow-control

I recognize that there may be reasons to drop IXON and IXOFF by
default, but they are not appropriate for situations in which IXON and
IXOFF are legitimately needed.  Perhaps a configuration option here?

Thanks,

John

-- System Information:
Debian Release: 10.1
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.19.0-6-amd64 (SMP w/4 CPU cores)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_WARN, TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=en_US.utf8, LC_CTYPE=en_US.utf8 (charmap=UTF-8), LANGUAGE=en_US.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages openssh-client depends on:
ii  adduser           3.118
ii  dpkg              1.19.7
ii  libc6             2.28-10
ii  libedit2          3.1-20181209-1
ii  libgssapi-krb5-2  1.17-3
ii  libselinux1       2.8-1+b1
ii  libssl1.1         1.1.1c-1
ii  passwd            1:4.5-1.1
ii  zlib1g            1:1.2.11.dfsg-1

Versions of packages openssh-client recommends:
ii  xauth  1:1.0.10-1

Versions of packages openssh-client suggests:
pn  keychain      <none>
pn  libpam-ssh    <none>
pn  monkeysphere  <none>
ii  ssh-askpass   1:1.2.4.1-10

-- no debconf information


Reply to: