Repository navigation
feat(runtime,sosix): Darwin local_ipc_v1 owner + SOSIX Seatbelt activation leaf (C7) - #9020
Merged
Merged
Conversation
ormastes
temporarily deployed
to
self-review-admission
November 13, 2026 14:10 — with
GitHub Actions
Inactive
ormastes
force-pushed
the
work/darwin-local-ipc-sandbox-abi
branch
from
November 13, 2026 17:26
f15b875 to
3c6255b
Compare
ormastes
temporarily deployed
to
self-review-admission
November 13, 2026 17:26 — with
GitHub Actions
Inactive
ormastes
force-pushed
the
work/darwin-local-ipc-sandbox-abi
branch
from
November 13, 2026 18:46
3c6255b to
567896d
Compare
ormastes
temporarily deployed
to
self-review-admission
November 13, 2026 18:46 — with
GitHub Actions
Inactive
…ivation leaf Design doc/05_design/simple_container_macos_seatbelt.md §2.3, §9.1, §11.4, §15.2, §20 P2 (work item C7). Source only; nothing is qualified on a Mac. - runtime_local_unix_v1.h/_transfer_v1.h: Darwin implementation beneath local_ipc_v1 with the same token/generation/role/close receipts. Not a mechanical Linux port: PID-only origin (no PID namespace), validated absolute sun_path plus post-effect parent re-walk instead of /proc/self/fd anchoring, descriptor flags + SO_NOSIGPIPE applied after socket/accept/SCM receipt, peer = getpeereid cross-checked against LOCAL_PEERTOKEN and LOCAL_PEERPID (fail closed on disagreement or missing kernel PID). stdout stage/adopt stays Linux-only (unsupported on Darwin; no bridge symbol reference, so the Darwin seed link is unchanged). Non-Apple non-Linux hosts still answer -4. - local_ipc_v1.spl: local_unix_peer_identity_class_v1() reports the weaker Darwin class honestly; never an incarnation credential. - SOSIX Seatbelt leaf: sosix_darwin_sandbox_apply_v1 (Simple admission, receipt decode, error sanitization) over a narrow C call pair sandbox_init(profile,0,&err)+sandbox_free_error with a preallocated receipt; no unrestricted fallback; Unsupported on non-Darwin without native entry. - Darwin branch of local_unix_v1_selfcheck.c for later Mac qualification. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ormastes
force-pushed
the
work/darwin-local-ipc-sandbox-abi
branch
from
November 14, 2026 00:29
567896d to
fe5741d
Compare
ormastes
temporarily deployed
to
self-review-admission
November 14, 2026 00:29 — with
GitHub Actions
Inactive
ormastes
commented
Nov 14, 2026
ormastes
left a comment
Owner
Author
There was a problem hiding this comment.
Reviewed (Opus): macOS Native job failures are runner memory (3579 MiB < 3584 MiB reserve) and missing system LLVM, also red on main 42899640547 and unrelated PRs; no local_ipc/sandbox code involved. Diff scoped to its 12 files, merge-tree clean vs release/1.0.0, no nil, Option-decoded extern, non-Apple hosts return Unsupported/ReceiptUnavailable (fail closed), Linux IPC refactor behaviour-preserving. Owed Mac evidence (selfcheck run, child-process activation) stays tracked, not claimed. Non-rt_ leaf name: owner decision pending.
This branch was previously deployed
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.
Summary
Work item C7 (Darwin substrate) of
doc/05_design/simple_container_macos_seatbelt.md:§2.3 (
local_ipc_v1Linux-only gap), §9.1 (sandbox_init / sandbox_free_error ABI), §11.4, §15.2, §20 P2.Source only. Nothing here is qualified on a Mac, and no capability is advertised. The Darwin code fails closed.
1. Darwin implementation beneath
local_ipc_v1src/runtime/runtime_local_unix_v1.h,runtime_local_unix_transfer_v1.h,runtime_socket_nonblock.cThe public owned-handle, generation, role and close receipts are unchanged. This is not a mechanical copy of the Linux code (§15.2):
/proc/self/fdanchoring. The code connects or binds to the validated absolute path, which must be at most 103 bytes. After the operation it re-walks the parent with the same no-follow policy and compares device/inode with the retained parent. This only detects a swapped parent after the fact, so it is weaker than Linux. Ancestors still must not be writable by other UIDs.SOCK_CLOEXEC,accept4,MSG_CMSG_CLOEXECorMSG_NOSIGNAL. CLOEXEC, O_NONBLOCK andSO_NOSIGPIPEare set right after socket creation, accept and SCM receipt. There is a race window, documented in the header: a concurrent fork+exec can still inherit the descriptor.getpeereiduid/gid, cross-checked against the euid/egid in theLOCAL_PEERTOKENaudit token. The PID comes from the token and must matchLOCAL_PEERPID. Any disagreement, or no kernel PID, fails closed (-3). XNU reports the peer socket's last operating process, so this is weaker than Linux's connect-timeSO_PEERCRED.local_unix_peer_identity_class_v1()reports it asDarwinKernelObservedPeer, and neither class is an incarnation credential (§11.4).runtime_process.cpipe bridge, so it stays Linux-only and answers -4 on Darwin. Because Darwin never references the bridge symbols, the Darwin Rust seed link does not change.2. SOSIX Seatbelt activation leaf (§9.1)
src/lib/nogc_async_mut/sosix/darwin_sandbox_v1.spl(the Simple twin): profile admission (non-empty, at most 256 KiB, no NUL), receipt decoding, and error sanitization (printable ASCII only, at most 512 bytes).Applied.sosix_darwin_sandbox_apply_v1returnsUnsupportedwithout entering native code.src/runtime/runtime_sosix_darwin_sandbox_v1.h, included byruntime_process_owned.c:sandbox_init(profile, 0, &err)thensandbox_free_error.rt_*symbol (sosix_darwin_sandbox_apply_profile_v1, following the brief's naming). It has no portable meaning and no possible Rust-lane twin, so it sits outsidecheck-rt-dual-implementation-ratchet.shs. If you would rather name itrt_sosix_darwin_*, that needs an owner-approved designed-C-only allowlist row.Requirements touched
SC-MAC-004 (no workload after failed activation: no fallback;
Refused/unknown is neverApplied), SC-MAC-016 (reuses the canonical IPC owner, no second socket registry), SC-MAC-022 (no model-level success claimed as OS success), SC-MAC-023 (peer-identity limits published through a typed query).Verification (Windows host)
clang -fsyntax-onlywith llvm-mingw clang 23.1.2 onruntime_socket_nonblock.c,runtime_process_owned.candlocal_unix_v1_selfcheck.c: rc=0, and the same warning count as base (5 pre-existing-Wextra).__APPLE__and__linux__branches with-target arm64-apple-macos13and-target x86_64-unknown-linux-gnu. The Linux branch has the same 0 warnings as base. These stub headers are not the real SDK. Real Darwin/Linux compilation is still owed.bin/simple.exe test test/01_unit/lib/nogc_async_mut/sosix/darwin_sandbox_v1_spec.spl: 5/5 pass.test/01_unit/lib/io/local_ipc_listener_v1_spec.spl: 4/4 pass (unchanged).test/01_unit/lib/io/local_ipc_v1_spec.spl: 3/4 pass. The new peer-identity-class example passes. Thestale generationexample already failed on base with the same error: the Windows seed has no interpreter backing forrt_local_unix_*(unknown extern function: rt_local_unix_read_v1).check-rt-dual-implementation-ratchet.shs --rev HEAD --baseline-rev origin/release/1.0.0: did not finish on this host (killed by a 20-minute timeout with no verdict; Windows git-bash is too slow for it). Manual substitute: the diff adds no non-staticrt_*definition undersrc/runtime(grep of the added lines), so no new single-lane symbol is expected. The real gate is the CIfast-gatesjob.Left for Mac qualification (P2 exit gate)
__APPLE__branch ofsrc/runtime/test/local_unix_v1_selfcheck.c. It covers bytes, peer (uid/gid/pid), CLOEXEC/NONBLOCK/NOSIGPIPE, SCM rejection with no FD leak, shutdown, close/stale, symlinked ancestor, a sun_path that is too long, a writable parent, wrong UID, and listener 0666/unlink.LOCAL_PEERTOKEN/LOCAL_PEERPID, including after a socket handoff.Refusedwith sanitized text. Nothing here wires activation into a provider (C4 owns that).🤖 Generated with Claude Code