linux-um.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Glenn Washburn <development@efficientek.com>
To: linux-um <linux-um@lists.infradead.org>
Cc: Glenn Washburn <development@efficientek.com>
Subject: [PATCH 0/4] Improvements to port on various error conditions
Date: Thu,  3 Mar 2022 01:53:29 -0600	[thread overview]
Message-ID: <cover.1646292328.git.development@efficientek.com> (raw)

This patch series was inspired by the various issues I ran into while trying
login to a UML instance via telnet when using the ssl=port:XXXX option. The
issue was that I started the UML instance with option "ssl1=port:12345" and
when I tried to connect from the host using telnet, the telnet client connects
and immediately the connection is closed. In the UML instance, the only message
I was getting was a kernel log message "port_accept : port_connection returned 2".
I had to dig in the kernel source to figure out what the "2" meant, which gave
a clue as to what was going on.

The issue was that I didn't have in.telnetd installed and the "2" was the error
code from exec, which is ENOENT, or "No such file or directory". Patch #4
provides a more user friendly error on exec failure, which should prevent
users from needing to dig in the source to figure out what's going wrong.

The first patch allows exec to search for in.telnetd instead of having its
path hard coded, which may be different on different systems. It also allows
for the UML instance to be telneted into when the user is unprivileged and
the host does not have in.telnetd installed. The user can install in.telnetd
in to any path they can write to and set PATH accordingly. This is my actual
use case.

The second patch allows the user to specify the location of the port-helper
binary via the environment variable UML_PORT_HELPER. The use cause is the
same as above. If the envvar is not set, fallback to the hardcoded path to
port-helper.


The third patch checks if the port-helper path actually exists and is executable.
This allows the UML instance to check and fail early if port-helper can't be
run and to send and error message to the user via the kernel log letting the
user know the issue and potentially how to fix it (eg. set the UML_PORT_HELPER
envvar).

Glenn

Glenn Washburn (4):
  um: port_user: Search for in.telnetd in PATH
  um: port_user: Allow setting path to port-helper using UML_PORT_HELPER
    envvar
  um: port_user: Improve error handling when port-helper is not found
  um: run_helper: Write error message to kernel log on exec failure on
    host

 arch/um/drivers/port_user.c | 18 +++++++++++++++++-
 arch/um/os-Linux/helper.c   |  5 +++++
 2 files changed, 22 insertions(+), 1 deletion(-)

-- 
2.30.2


_______________________________________________
linux-um mailing list
linux-um@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-um


             reply	other threads:[~2022-03-03  7:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-03  7:53 Glenn Washburn [this message]
2022-03-03  7:53 ` [PATCH 1/4] um: port_user: Search for in.telnetd in PATH Glenn Washburn
2022-03-03  7:53 ` [PATCH 2/4] um: port_user: Allow setting path to port-helper using UML_PORT_HELPER envvar Glenn Washburn
2022-03-03  7:53 ` [PATCH 3/4] um: port_user: Improve error handling when port-helper is not found Glenn Washburn
2022-03-03  7:53 ` [PATCH 4/4] um: run_helper: Write error message to kernel log on exec failure on host Glenn Washburn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1646292328.git.development@efficientek.com \
    --to=development@efficientek.com \
    --cc=linux-um@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).