fix(wake): harden Darwin boot identity and zombie detection#236
Open
avivsinai wants to merge 5 commits into
Open
fix(wake): harden Darwin boot identity and zombie detection#236avivsinai wants to merge 5 commits into
avivsinai wants to merge 5 commits into
Conversation
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.
Lands the sound, self-contained portion of #232 (@ohade's Darwin wake work), reduced per review.
What's here
kern.bootsessionuuidinstead of wall-clockkern.boottime, with a bounded legacy compatibility path and aboottimefallback for older macOS.SZOMB(zombie) wake processes as not running, so their stale locks can be replaced.compareWakeBootID→ match / mismatch / unknown): a recorded boot id that cannot be checked against a comparable current source is unknown, not a match. Classification treats unknown asunverified(fail closed); the post-signalwakeProcessStillMatchestreats unknown as "keep checking" so a still-live wake is never misread as gone (which would remove its lock). Regression + end-to-end coverage added.What's deferred (not here)
Per the security review of #232,
amq wake retireand the accept-existing target reuse were dropped: the underlying wake lock/signal machinery (bare-PID signal, non-atomic lock lifecycle, mode persistence) is not yet a safe foundation for an "identity-safe" stop command. That hardening — and reintroducingretireon top — is tracked in #235. Hostile-filesystem hardening of the message path is #233.Original Darwin wake work by @ohade (#232). This reduced landing was reviewed and verified by Claude + Codex, including an adversarial GPT-5 Pro pass that drove the tri-state boot-identity fix.
Co-Authored-By: Ohad Edelstein ohade@users.noreply.github.com
🤖 Generated with Claude Code