Keep Linux daemon identity stable across clock changes - #67
Merged
Conversation
Process creation time derived from the wall clock is not a stable PID-reuse boundary on Linux. WSL can correct its clock while a daemon remains alive, causing clients to classify the same owner as a replacement and delete its runtime record while its lifetime lock remains held. Use boot identity, PID 1 start ticks, and process start ticks for Linux. Store the new value in a versioned field while leaving the legacy field empty, so older clients fail closed instead of deleting records they cannot understand; legacy Linux timestamps also remain non-authoritative after upgrade. Validation: the full Windows suite, vet, and build pass; the Linux daemon suite passes under the race detector. Generated with Codex Co-authored-by: Codex <noreply@openai.com>
roborev: Combined Review (
|
Daemon identity must remain available under hidepid and ProtectProc, where the daemon can inspect itself but not PID 1. Bind identity to the target process namespace, boot, and start ticks so PID reuse and namespace restarts remain distinguishable without privileged proc access.\n\nVersion the encoding so earlier Linux identities fail closed rather than authorizing cleanup across schemes. Generated with Codex\nCo-authored-by: Codex <noreply@openai.com>
roborev: Combined Review (
|
A version prefix alone cannot establish that a stored identity is safe to compare. A truncated or corrupt value must remain non-authoritative so callers never interpret it as permission to replace a live process or delete its record. Require the complete Linux identity grammar before comparison. Valid identities can still report a mismatch when one authoritative component changes. Generated with Codex Co-authored-by: Codex <noreply@openai.com>
roborev: Combined Review (
|
Versioned runtime identity takes precedence over the legacy field, so accepting arbitrary encodings can turn an unsupported or corrupt value into destructive mismatch authority. Every platform must first prove that an identity has the exact format it currently emits. Treat this PR's namespace-based Linux identity as its first public encoding rather than carrying compatibility for an intermediate branch-only representation. Generated with Codex Co-authored-by: Codex <noreply@openai.com>
roborev: Combined Review (
|
Parseable alternate encodings can never equal the canonical live identity, so treating them as mismatches would grant destructive authority to malformed runtime records. Require the exact lowercase boot ID and positive decimal forms emitted by Kit before comparison. Validation: cross-compiled the Linux daemon tests and executed them inside WSL. Generated with Codex Co-authored-by: Codex <noreply@openai.com>
roborev: Combined Review (
|
Non-Linux process identity is emitted from a positive int64 creation time. Accepting the wider unsigned range lets impossible stored values become authoritative mismatches, which callers may interpret as permission for destructive replacement instead of failing closed. Generated with Codex Co-authored-by: Codex <noreply@openai.com>
roborev: Combined Review (
|
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.
hidepidandProtectProcwhen the daemon can inspect itself but not PID 1, while distinguishing PID reuse and namespace restarts.maintreat records they cannot understand as unknown rather than destructive mismatches.