Repository navigation
wolfsshd: survive fork failure, fail startup loudly - #1328
Conversation
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
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 - log "Closing down wolfSSHD" whenever the accept loop exits, not only on quit, so the error exits still log it - 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 1 in-scope changed file(s) opened by the reviewer
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
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