Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 04 Sep 2023 18:00:37 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-arm@FreeBSD.org
Subject:   [Bug 273566] stray characters contaminate serial console
Message-ID:  <bug-273566-7@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D273566

            Bug ID: 273566
           Summary: stray characters contaminate serial console
           Product: Base System
           Version: CURRENT
          Hardware: arm
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: arm
          Assignee: freebsd-arm@FreeBSD.org
          Reporter: fbsd@www.zefox.net

>From time to time serial console connections on raspberry Pi (2, 3 and 4)
systems allow stray characters to enter serial console commands. Since the
console is often used by root, this seems potentially insecure.=20

The setup consists of a pair of Pi's. One holds a usb-serial adapter,
with the serial end connected to a second Pi's console uart. Connection=20
is established by ssh into the first Pi, starting tip or cu, and then
logging into the second Pi into the usual way. Often, login is to root.

Often, the ssh connection to the first Pi drops spontaneously. It can be
re-established by repeating the connection procedure, if the original
shell running on the second Pi's serial console is still running the old
session remains up and prior commands can be run from history.

When that is done, sometimes the apparent "last words" to the second Pi
appear to be things that were never intentionally entered before the=20
disconnect. Here's one example, in this case the terminal session is
running on a Pi4 running RasPiOS, the ssh connection is to a Pi2 running
FreeBSD 14.0-ALPHA4 armv7 1400097 (GENERIC) #1, the Pi running the serial
console is running 15-current:client_loop: send disconnect: Broken pipe
bob@raspberrypi:~ $ ssh 192.168.1.13
Password for bob@generic:
Last login: Mon Sep  4 08:14:21 2023 from 192.168.1.10
FreeBSD 14.0-ALPHA4 armv7 1400097 (GENERIC) #1 stable/14-n265029-d6fec2dacf=
80:
Mon Sep  4 02:12:35 PDT 2023

Welcome to FreeBSD!

Release Notes, Errata: https://www.FreeBSD.org/releases/
Security Advisories:   https://www.FreeBSD.org/security/
FreeBSD Handbook:      https://www.FreeBSD.org/handbook/
FreeBSD FAQ:           https://www.FreeBSD.org/faq/
Questions List:        https://www.FreeBSD.org/lists/questions/
FreeBSD Forums:        https://forums.FreeBSD.org/

Documents installed with the system are in the /usr/local/share/doc/freebsd/
directory, or can be installed later with:  pkg install en-freebsd-doc
For other languages, replace "en" with a language code like de or fr.

Show the version of FreeBSD installed:  freebsd-version ; uname -a
Please include that output and any error messages when posting questions.
Introduction to manual pages:  man man
FreeBSD directory layout:      man hier

To change this login announcement, see motd(5).
To see the last 10 lines of a long file, use "tail filename". To see the
first 10 lines, use "head filename". To see new lines as they're appended
to a file, use "tail -f filename".
                -- Dru <genesis@istar.ca>
bob@generic:~ % su
Password:
# tip ucom
Stale lock on cuaU0 PID=3D1181... overriding.
connected
Y\HHMHLN\247\261=CD=81\315m\335u=E9=81=95\311\351=CD=A1}}=C2=A5=D1=A5=D1=A5=
=C2=BD
YHHMHLN=EF=BF=BD=EF=BF=BD=CD=81=EF=BF=BDm=EF=BF=BDu=E9=81=95=EF=BF=BD=EF=BF=
=BD=CD=A1}}=EF=BF=BD=D1=A5=D1=A5=EF=BF=BD: Command not found.
bob@pelorus:/usr/src % =C2=BD=C2=B9=C2=B9=D1=A5=C2=BD=C2=B9=C2=B1=C2=BD=CD=
=95=C3=A5=C9=95=C2=B5=C2=BD=D1=95=C2=A1=C2=BD=C3=8D=C3=915)5)5)=C3=BF
Too many )'s.
bob@pelorus:/usr/src

If one types up-arrow to recall history, the first few old "commands"
are rubbish, though they are not un-displayable as would be expected
from line noise (the copy-paste from FreeBSD to RasPiOS is misleading).

In this example an FTDI-232 was in use, but PL2303 has behaved similarly.

The origin of the disconnect is unclear. I think it's a problem with
ssh between the RasPiOS terminal and the Pi holding the USB-serial=20
adapter, but don't know how to tell for sure. It seems to be load-related,
with a busy FreeBSD Pi more inclined to drop connections even if the
connection itself is entirely idle.=20

FWIW, stable/12 does not display this behavior, with ssh-usb-serial-console
connections staying up for days or weeks.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-273566-7>