This repository was archived by the owner on Oct 30, 2026. It is now read-only.
Repository navigation
Clean up palera1n on SIGTERM and explain an unexpected Pongo - #9
Merged
henrikklee merged 2 commits intoOct 29, 2026
Merged
Conversation
SIGTERM (pkill, logout) ended Orchard without unwinding, so the process group was left running exactly as before. While palera1n runs, turn SIGTERM into SystemExit so the group is killed on the way out. The handler is installed only on the main thread and restored afterwards. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A stray palera1n/checkra1n exploiting the device behind Orchard's back showed up only as "Expected dfu at the selected port; found pongo". Say what likely happened and how to recover. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Follow-up to #8, which was merged before these two commits were pushed.
Clean up the palera1n group on SIGTERM
#8 kills palera1n's process group when Orchard stops waiting because of a timeout or Ctrl-C. A plain SIGTERM (
pkill orchard, closing a session, a service manager stopping it) still ended Orchard without unwinding. That left checkra1n running, which is the same orphan #8 fixes.run_process_groupnow turns SIGTERM intoSystemExit(143)while palera1n runs, so the existingexcept BaseExceptionkills the group on the way out. The handler is installed only on the main thread (boot()runs there for bothinstallandlaunch) and restored afterwards, so SIGTERM behaves as before everywhere else.New test
test_bootstrap_sigterm_stops_spawned_children: a child Python process runsrun_process_groupon a command that backgrounds a long-lived child, then gets SIGTERM. With the handler, it exits with 143 and the child is gone. Without the handler, the test fails (-15 != 143) and the child survives.Explain an unexpected Pongo
When something else exploited the device, Orchard reported only
Expected dfu at the selected port; found pongo. For that one DFU→Pongo case, the message now adds:Other mismatches keep their current message.
Testing
The three bootstrap tests plus
test_usb_readinesspassed 5 out of 5 runs on top of currentmain.🤖 Generated with Claude Code