tinyssh: add package#30036
Conversation
Pinned to 3d93382 due to unreleased security fixes. Ships tinysshd-listen, a small accept-and-fork TCP supervisor to avoid heavier deps or busybox changes. Skips RELRO to stay small; safe since it parses no input. Signed-off-by: Mario Rugiero <mrugiero@gmail.com>
openwrt-ai
left a comment
There was a problem hiding this comment.
Reviewed the new tinyssh package (1 commit, fresh review). The commit message matches the changes. Two inline notes below: a data race on the live connection counter shared with the SIGCHLD handler, and an IPv6-reachability question in the init script. The RELRO drop for tinysshd-listen and the LDFLAGS filter look correct against include/hardening.mk.
Generated by Claude Code
| execvp(argv[3], &argv[3]); | ||
| _exit(111); | ||
| } | ||
| if (pid > 0) live++; |
There was a problem hiding this comment.
live is read-modify-written both here (live++) and in the reap() SIGCHLD handler (live--, line 19). sig_atomic_t only guarantees atomicity for a single read or write, not for a read-modify-write, and reap() can interrupt the main thread mid-update. If SIGCHLD is delivered while live++ is in flight (load/add/store), the handler's decrement is overwritten and lost, so live drifts upward over time. Once it is stuck at >= maxconns the supervisor refuses every new connection — a slow self-inflicted DoS whenever -c is used (the init passes -c 20 by default).
Consider blocking SIGCHLD with sigprocmask around the live >= maxconns check and the increment, or reaping synchronously in the accept loop instead of mutating the counter from the handler.
Generated by Claude Code
| return 1 | ||
| } | ||
|
|
||
| bindaddr="0.0.0.0" |
There was a problem hiding this comment.
nit: bindaddr defaults to 0.0.0.0 and, when an interface is configured, only network_get_ipaddr (IPv4) is consulted, so tinysshd-listen is only ever handed an IPv4 address — even though it fully supports AF_INET6. As written IPv6 clients can never reach the daemon, which differs from dropbear (the in-tree SSH server) that listens on both families by default. Is IPv4-only intended, or should the default / interface handling also cover IPv6 (e.g. a second procd instance bound to :: or the interface's IPv6 address via network_get_ipaddr6)?
Generated by Claude Code
|
Look, I'm wondering why we should add another package to the SSH category when we already have plenty of packages focused on this. Do you have a comparison with the other SSH packages we have here? I don't really think it's appropriate to keep adding more packages when we already have existing ones, because that would be choosing quantity over quality. Plus, you mention in the pull request yourself that it would be advisable to use the latest versions containing security fixes, and considering this is the first pull request for adding tinyssh... I'm just being cautious, nothing more. |
The main difference in my view here is that its memory overhead when not connected is minimized by only having the socket listener. Then, reduced scope. I tend to prefer my systems (specially my router, which is a rather limited model) to only do what they need to do, and I don't need the client functionality or the scp that dropbear comes with. I don't know the tmate client (just found about it with Just to be clear, even though I'd very much like it to be included, I'm gonna use it for myself and if you don't want to merge it it's OK with me, I'm just explaining why I personally prefer this client.
I understand. I didn't know we had more than dropbear honestly. I know what they say about "assume", but I assumed that really, didn't expect many others and didn't find the one I wanted to use :)
Isn't this true for any security-relevant package? The release cadence seems to be about bi-monthly and there are ~12 commits after the latest release starting June.
That's a healthy attitude, yes. EDIT: not I see the CI failures and AI review, but I think since this might be blocking I'm gonna wait until we resolve whether this has a chance of merging in the first place before trying to address them. |
📦 Package Details
Maintainer: @Oppen
Description:
TinySSH is a minimalistic SSH server which implements only a subset of
SSHv2 features.
Pinned to 3d93382 due to unreleased security fixes.
Ships tinysshd-listen, a small accept-and-fork TCP supervisor to avoid
heavier deps or busybox changes. Skips RELRO to stay small; safe since
it parses no input.
🧪 Run Testing Details
✅ Formalities