Repository navigation
Prevent unsafe native PID reuse and signalling - #275
Merged
Merged
Conversation
Owner
Author
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Hooray! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
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.
Closes #269
A stale native PID file could identify an unrelated process as MemoryD and cause
downorrestartto send it SIGTERM. On Linux, the lifecycle binds a per-launch identity to the runtime and acquires a pidfd before checking identity; shutdown signals and waits through that same handle. Unverifiable legacy or malformed live state fails closed. The repository helper uses the same managed lifecycle and rejects older CLI binaries before invoking lifecycle commands.The numeric PID file is retained, with a private identity sidecar and lifecycle lock. The daemon removes the launch marker from its inherited environment before acknowledging. Linux kernel sender credentials bind that acknowledgment to the captured process; the selected daemon executable is pinned to the running manager image so a wrapper cannot start an untracked daemon. See the getting-started guide for legacy recovery and compatibility. Managed native lifecycle on macOS and other non-Linux platforms deliberately fails closed; foreground
serveand container mode remain available.Reproductions used temporary homes, unused loopback ports and disposable children only:
79a279d5f730162ad34be9b6410e666ba878a05c, asleepPID in a legacy file madestatusreport running anddownsend SIGTERM to that child (exit -15).e70337b5fd5dbe4f60225b186485d37f8607776freproduced two issues: (1) a wrapper could cause its child daemon to acknowledge for the wrapper, thendownreturned success while the daemon still served HTTP; (2) FIFO PID or identity files blocked lifecycle commands. Both were reproduced in the cloud worker and repaired in752fc47617fc73101497ddf42616208f80d0f586. On that head the same wrapper fails before it executes, and FIFO status promptly returnsunverifiedwhile preserving the FIFO. The sender-credential regression separately proves a descendant cannot acknowledge for the captured process.Validation on the exact tested head
752fc47617fc73101497ddf42616208f80d0f586:All commands passed. The focused suites passed 5 process-handle/identity tests, 14 PID/helper tests, 4 native-instance tests, and the status-precedence test. They cover descendant acknowledgment, both FIFO paths, preservation of state, surviving disposable children, lock reuse, PID reuse, exit before signal, symlink pinning, and normal lifecycle. The full synthetic gate includes all repository tests, formatting, child-reaper checks, doctor, evals and perf. The live dogfood lane was excluded.
Both current-head PR CI jobs passed: Linux release gate, locked release build and lifecycle smoke; and macOS native lifecycle safety.
Independent Sol High re-review completed for
752fc47617fc73101497ddf42616208f80d0f586with no unresolved safety findings in the reviewed scope. It independently closed both reported reproductions and passed process-handle, PID/helper and native CLI tests, plus symlink/hard-link and old-binary cases, concurrency, persistence/restart, and separate pidfd syscall-denial probes. FIFO PID, identity, and lock cases with absent and connected peers returned promptly, preserved state, left disposable children alive, and left the lock usable. This is review evidence relayed by the integration owner, not a GitHub approval.Remaining coverage limits: actual kernel PID recycling, older kernels, restricted procfs and crash injection were not exercised in the independent review. Actual macOS fail-closed execution passed in CI; Linux lifecycle CI passed. The documented same-executable
CODEX_MEMORYD_BINrestriction and non-Linux managed-lifecycle limitation remain compatibility changes.The connector review completed on
752fc47617fc73101497ddf42616208f80d0f586with no findings; its review receipt confirms the reviewed commit. The operator authorized merging after the checks and reviews passed.