Repository navigation
wolfsshd: survive fork failure, fail startup loudly - #1328
Open
ejohnstown wants to merge 2 commits into
Open
ejohnstown wants to merge 2 commits into
ejohnstown wants to merge 2 commits into
Conversation
StartSSHD() no longer stores the NewConnection() result in ret, the accept loop's condition. A failed fork() or CreateThread() now drops that one connection, and the daemon goes on listening. - add sshd_fork_fail_test.sh with an LD_PRELOAD shim that fails the first connection's fork() with EAGAIN - run it from run_all_sshd_tests.sh on leased port +7 Issue: F-16052
The POSIX StartSSHD() now returns EXIT_FAILURE when ret holds an error, and main() passes that on. A config check (-t) of a bad config, a failed host key load, or a bad -p now exit 1 instead of 0. - set ret when the accept loop cannot allocate a connection, so that stop also exits non-zero - PendingConnection() returns negative on a select() error other than EINTR, and the accept loop sets ret from it instead of quit - add sshd_exit_status_test.sh, which checks -D -t exit codes for a valid config and three startup failures Issue: F-16053
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #1328
Scan targets checked: wolfssh-src, wolfssh-bugs
Not reviewed (no scan target covers them): .gitignore, apps/wolfsshd/test/run_all_sshd_tests.sh, apps/wolfsshd/test/sshd_exit_status_test.sh, apps/wolfsshd/test/sshd_fork_fail_test.sh
Coverage: 1 of 2 in-scope changed file(s) opened by the reviewer; not opened: apps/wolfsshd/test/sshd_fork_preload.c
Fenrir result: Approved ✅
No new issues found in the changed files.
Advisory only — this automated result does not count as a GitHub approval.
Review tier: Lite
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
wolfsshd keeps listening when a fork() or CreateThread() for one
connection fails, and now exits non-zero when startup fails.
loop; sshd_fork_fail_test.sh forces EAGAIN with an LD_PRELOAD shim.
port, and on a select() error; sshd_exit_status_test.sh checks them.
Issue: F-16052, F-16053