[Bug 2056485] Re: Behaviour of socat in Ubuntu 20.04 unexpected
Frank Heimes
2056485 at bugs.launchpad.net
Thu Apr 11 09:49:43 UTC 2024
Well, to me it looks like socat is like a Swiss army knife, where some
features are popular and are used often, but others are very rarely
used.
Also please consider potential reactions of users that run into this (or similar cases):
1) (trivial) Users notice this problem (or not) and don't do anything.
We would not become aware of a problem, hence nothing will be done. Things are probably less important and critical.
2) Users notice this problem and work around this, but do not open a bug.
It is fixed for that particular user, and this user is well aware about the bug, since it got fixed by him/her; but this is not the desired reaction, since a bug should have been opened on top to report this.
3) Users notice this problem (and work around this or not), and open a bug.
This is (imho) the desired behavior - due to the report and with that the ask to get it fixed. And with an update on the bug, they'll get a notification.
Item 3) might cause an adjustment on their side once a fix got rolled
out, but will protect for upgrade regressions.
The fact that a package wasn't modified for a while does not necessarily
mean that no modifications were needed.
In this case here, several users reported this (way) earlier in LP:
#1883957, and (I think) are waiting for a fix, and we do not know all
their use cases, hence it's virtually impossible to have workarounds in
place for all potential cases (we only have the needed details for just
one: LP#1883957, but shouldn't limit ourselves to this).
So I am still an advocate for getting things fixed where they are broken and believe that this also helps to reduce risk, compared to touching more/other components and at the end maybe not being able cover everything.
The idea of using LP2056485_SOCAT_BEHAVIOUR could work, but might again lead to other risks, like cases where user may switch accounts, but in a way that they loose previously set environment variables etc. - I personally would consider that as more risky and overkill.
But the final decision is of course at the SRU team.
Meanwhile I've modified the patched package to just cover the two hunks
that are related to the TERMIOS_PH_ALL test case - if we will go that
route or not. Just try to speed up things in case this will be the way
to go ... (since this is about a customer case)
(Btw. I have marked LP#1883957 as dup of LP#2056485, because as partner/customer case LP#2056485 came in via the BZ-2-LP-bridge and will cause issues otherwise. But I've referenced both bugs in the changelog, see debdiff - it's probably not the best way, but want to ensure that people who reported this will be notified in case of a fix.
If there is a better way, I am happy t adapt it ...)
PPA test build (with minimized patch for test case):
https://launchpad.net/~fheimes/+archive/ubuntu/lp2056485-3
(build includes successful tests)
The updated debdiff is attached.
--
You received this bug notification because you are a member of Ubuntu
Sponsors, which is subscribed to the bug report.
https://bugs.launchpad.net/bugs/2056485
Title:
Behaviour of socat in Ubuntu 20.04 unexpected
Status in The Ubuntu-power-systems project:
In Progress
Status in socat package in Ubuntu:
Fix Released
Status in socat source package in Focal:
Incomplete
Bug description:
SRU Justification:
[ Impact ]
* IBM Novalink provides a tool called mkvterm.
Mkvterm takes an lpar id argument and creates a vty-server device on
device nodes /dev/hvcs*.
HVCS is a device driver for the IBM Hypervisor Virtual Console Server
(hvcs). Mkvterm then uses socat to connect.
* But socat is not behaving as expected.
When escape=0x1d is passed, you have to hit enter for socat to close
(expected behavior is Ctrl-] closing the connection).
* In addition, Ctrl-C closes the connection.
When using the up and down arrows, junk is printed.
Password is also visible!
* This is caused by the fact that under certain circumstances,
options of the first address are applied to the second address.
[ Fix ]
* 5ebf36038f39 5ebf36038f3960798e769bff5646e755a91a1119
"Under certain circumstances, options of the first address were applied to the second address"
* 9de26f1d0528 9de26f1d05284257cd9bbb6eb6662089ab7a0680
"minor corrections, not affecting binaries"
[ Test Plan ]
* There was a special test case introduced for this change
it's test #385.
If this succeeds, the reported issue is solved.
* Initially this test case failed, because it required another commit
on top: 9de26f1d0528
* To verify the overall end-2-end case, the fixes from LP#056373 are required
as well, but can be taken from the PPA test build that was done there.
* Then configure a vty-server and try to connect with socat:
/usr/bin/socat STDIO,raw,echo=0,escape=0x1d /dev/hvcs[minor num]
* With an unpatched version one will see that the password is
visible.
* In addition, the up and down arrows do not work and junk is outputted.
In addition, Ctrl-] does not close the vterm.
* Ctrl-C closes the vterm, and it should not.
* With a patched version the password will not be visible,
Ctrl+] and Ctrl+C behave as expected.
[ Where problems could occur ]
* The code modification is limited to a single line in if
and is pretty traceable, and it's on top limited to terminos.
* If the changed condition of IF was done wrong, the expected
behavior can change (again) and unforeseen things may happen.
* The rest of the code changes are text in CHANGES and
a new test case, introduced especially for this bug.
* Nevertheless, issues can also occur in the (additional)
test code (which happened and got fixed by adding 9de26f1d0528).
[ Other Info ]
* Even the code states that this bug is limited to v1.7.3.3.
* Nevertheless, the code of the socat versions of jammy, mantic
and noble were checked, and they all have the fix included.
(However the code in noble's version changed a bit).
* So only focal is affected.
__________
---Problem Description---
Novalink provides a tool called mkvterm. Mkvterm takes an lpar id argument and creates a vty-server device on device nodes /dev/hvcs*. HVCS is a device driver for the IBM Hypervisor Virtual Console Server (hvcs). Mkvterm then uses socat to connect.
Socat is not behaving as expected. When escape=0x1d is passed, you
have to hit enter for socat to close (expected behavior is Ctrl-]
closing the connection). In addition, Ctrl-C closes the connection.
When using the up and down arrows, junk is printed. Password is also
visible.
The follow commit fixes the above issues, please add:
https://repo.or.cz/socat.git/commit/5ebf36038f39
---uname output---
Linux neop91.pok.stglabs.ibm.com 5.4.0-173-generic #191-Ubuntu SMP Fri Feb 2 13:54:35 UTC 2024 ppc64le ppc64le ppc64le GNU/Linux
---Steps to Reproduce---
Fixes to other issues required to reproduce. Mentioned in other bugs.
Configure a vty-server and try to connect with socat:
/usr/bin/socat STDIO,raw,echo=0,escape=0x1d /dev/hvcs[minor num]
Add You will see that the password is visible. In addition, the up and
down arrows do not work, junk is outputted. In addition, Ctrl-] does
not close the vterm. Ctrl-C closes the vterm, and it should not.
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu-power-systems/+bug/2056485/+subscriptions
More information about the Ubuntu-sponsors
mailing list