Skip to content

silkd: git on every lane, and relay dials without a blocking-pool hop - #503

Merged
CMGS merged 6 commits into
mainfrom
silkd/git-any-lane-cloexec
Nov 7, 2026
Merged

CMGS merged 6 commits into
mainfrom
silkd/git-any-lane-cloexec

Conversation

@CMGS

@CMGS CMGS commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

Two silkd follow-ups to #502, as ruled by CMGS after the whole-repo audit.

  • git on every lane. The none-lane refusal of git clone/push/pull predates the egress proxy relay. A none-lane guest whose policy allows the git host now reaches it the same way exec git clone already did. Without such a policy, git fails with its own error. The test-only lane override goes with the check. docs/sdk.md, docs/sdk-python.md, docs/silkd.md and the SDK comments stop pointing none-lane git at Push.
  • Relay dial without a thread hop. silkd: session exit codes under xtrace, supplementary groups, close-on-exec relays, long file names #502 made the egress relays dial close-on-exec by connecting on the blocking pool. That cost one thread hop per proxied connection and per DNS datagram, and a stalled host could tie up blocking threads past DATAGRAMS_IN_FLIGHT. The socket is now created SOCK_CLOEXEC|SOCK_NONBLOCK (unsafe isolated in sysutil.rs with // SAFETY: lines) and the connect is awaited on the reactor.

Verified in a rust:1 linux/arm64 container: cargo fmt --check, cargo clippy --locked --all-targets -D warnings, cargo test --locked. The vsock dial runs only inside a guest; a hardware A/B on cocoon-test2 is measuring the per-connection and per-DNS-query cost against the pre-audit and #502 silkd, and this PR waits for that result.

CMGS added 6 commits November 7, 2026 20:35
The none-lane refusal predates the egress proxy relay: a none-lane guest with a policy allowing the git host reaches it through the relay, the same way exec git clone already does, yet GitClone answered unimplemented. Without such a policy git fails with its own error. The test-only lane override goes with the check, and the docs and SDK examples stop pointing none-lane git at Push.
… instead of a blocking-pool hop

The close-on-exec fix moved each relay connect onto the blocking pool, one thread hop per proxied connection and per DNS datagram, and a stalled host could tie up blocking threads past DATAGRAMS_IN_FLIGHT. The socket is now created SOCK_CLOEXEC|SOCK_NONBLOCK and the connect awaited on the reactor.
… answer, and drop the remaining network-lane-only notes

smoke's push without a remote and the Python e2e's clone of a host no policy allows now fail with git's own error (internal) instead of unimplemented. The wire, SDK and test docs and egress.md stop tying git to a lane.
…ress step read a repository's status

The egress step pushed a repository without a remote, which fails the same way on every lane now, so it proved nothing about the lane; it now claims an egress-lane sandbox and reads a status through it.
…user

Moving the uid/gid drop into the pre_exec hook left std's chdir running as root before it, so a cwd the user cannot enter no longer failed the spawn. With a user and root, the hook now enters the cwd after setuid, and the spawn answers bad_request again; a root-only test pins it.
@CMGS
CMGS merged commit 5cdef6b into main Nov 7, 2026
3 checks passed
@CMGS
CMGS deleted the silkd/git-any-lane-cloexec branch November 7, 2026 13:46
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