Skip to content

fix(wake): harden Darwin boot identity and zombie detection#236

Open
avivsinai wants to merge 5 commits into
mainfrom
wake/darwin-boot-identity-hardening
Open

fix(wake): harden Darwin boot identity and zombie detection#236
avivsinai wants to merge 5 commits into
mainfrom
wake/darwin-boot-identity-hardening

Conversation

@avivsinai

Copy link
Copy Markdown
Owner

Lands the sound, self-contained portion of #232 (@ohade's Darwin wake work), reduced per review.

What's here

  • Darwin wake identity uses the stable kern.bootsessionuuid instead of wall-clock kern.boottime, with a bounded legacy compatibility path and a boottime fallback for older macOS.
  • Darwin process inspection treats unreaped SZOMB (zombie) wake processes as not running, so their stale locks can be replaced.
  • Boot-identity comparison is tri-state (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 as unverified (fail closed); the post-signal wakeProcessStillMatches treats 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 retire and 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 reintroducing retire on 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant