netutils/dropbear: retain child exit status for NSH PTY session#3648
Open
FelipeMdeO wants to merge 1 commit into
Open
netutils/dropbear: retain child exit status for NSH PTY session#3648FelipeMdeO wants to merge 1 commit into
FelipeMdeO wants to merge 1 commit into
Conversation
Contributor
Author
|
Hello @acassis , @xiaoxiang781216 , @linguini1 , can you take a look, please? |
linguini1
previously approved these changes
Jul 18, 2026
xiaoxiang781216
pushed a commit
to apache/nuttx
that referenced
this pull request
Jul 19, 2026
Dropbear's NSH PTY session reaps the child task with waitpid() and needs CONFIG_SCHED_CHILD_STATUS, which depends on SCHED_HAVE_PARENT. The netutils/dropbear Kconfig now depends on SCHED_HAVE_PARENT and selects SCHED_CHILD_STATUS (apache/nuttx-apps#3648); set SCHED_HAVE_PARENT here so the dropbear defconfig stays consistent and the session no longer fails with ECHILD after authentication. Signed-off-by: Felipe Moura <moura.fmo@gmail.com>
FelipeMdeO
force-pushed
the
fix/dropbear-retain-child-status
branch
from
July 19, 2026 16:10
26523ec to
e1b8c8f
Compare
FelipeMdeO
added a commit
to FelipeMdeO/nuttx
that referenced
this pull request
Jul 19, 2026
Dropbear's NSH PTY session reaps the child task with waitpid() and needs
CONFIG_SCHED_CHILD_STATUS (which depends on SCHED_HAVE_PARENT). Without it
the session fails with ECHILD right after authentication
("NSH session wait failed: Unknown error 10").
netutils/dropbear now "depends on SCHED_CHILD_STATUS" per the project's
depends-on-over-select policy (apache/nuttx-apps#3648), so enable it in the
sim and esp32c3-devkit Dropbear defconfigs (SCHED_HAVE_PARENT is already
enabled there).
Signed-off-by: Felipe Moura <moura.fmo@gmail.com>
FelipeMdeO
force-pushed
the
fix/dropbear-retain-child-status
branch
from
July 19, 2026 16:16
e1b8c8f to
12f1348
Compare
acassis
approved these changes
Jul 19, 2026
linguini1
pushed a commit
to apache/nuttx
that referenced
this pull request
Jul 19, 2026
Dropbear's NSH PTY session reaps the child task with waitpid() and needs
CONFIG_SCHED_CHILD_STATUS (which depends on SCHED_HAVE_PARENT). Without it
the session fails with ECHILD right after authentication
("NSH session wait failed: Unknown error 10").
netutils/dropbear now "depends on SCHED_CHILD_STATUS" per the project's
depends-on-over-select policy (apache/nuttx-apps#3648), so enable it in the
sim and esp32c3-devkit Dropbear defconfigs (SCHED_HAVE_PARENT is already
enabled there).
Signed-off-by: Felipe Moura <moura.fmo@gmail.com>
linguini1
approved these changes
Jul 19, 2026
The per-session NSH task is reaped with waitpid() in
dropbear_nshsession.c. Without CONFIG_SCHED_CHILD_STATUS the kernel does
not retain the child exit status, so waitpid() returns ECHILD right after
authentication and the interactive session never starts
("NSH session wait failed: Unknown error 10").
Depend on SCHED_HAVE_PARENT and SCHED_CHILD_STATUS (following the project's
depends-on-over-select convention) so the requirement is explicit; boards
enabling Dropbear must set these in their defconfig.
Signed-off-by: Felipe Moura <moura.fmo@gmail.com>
FelipeMdeO
force-pushed
the
fix/dropbear-retain-child-status
branch
from
July 20, 2026 00:09
d82a4f8 to
b818800
Compare
xiaoxiang781216
approved these changes
Jul 20, 2026
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.
Summary
Dropbear reaps the per-session NSH task with
waitpid()indropbear_nshsession.c. WithoutCONFIG_SCHED_CHILD_STATUSthe kernel doesnot retain the child exit status, so
waitpid()returnsECHILDright afterauthentication and the interactive session never starts
(
NSH session wait failed: Unknown error 10).The issue was reported here: apache/nuttx#19209
Depend on
SCHED_HAVE_PARENT(required bySCHED_CHILD_STATUS) and selectSCHED_CHILD_STATUSso any Dropbear build gets a working interactive session.Impact
Kconfig-only, 2 lines. Fixes interactive SSH sessions for
NETUTILS_DROPBEAR.No dependency on other in-flight work.
Testing
Built
sim:dropbear(nuttx master + this change) and connected over SSH:on device side:
On host side: