8000 fix(minimald): name proxied connection owners in one /proc walk · gominimal/minimal@eadad7a · GitHub
[go: up one dir, main page]

Skip to content

fix(minimald): name proxied connection owners in one /proc walk

Minimal Arch / arch-review succeeded Nov 4, 2026 in 0s

PASS

Baseline. This re-reviews eadad7ab against the CONDITIONS on cde5eaca (this PR), on arch 7a86ec7b. I checked these facts. since.diff equals git diff cde5eaca eadad7ab. pr.diff equals git diff befda07d eadad7ab, and befda07d (#2968) is the merge base. The compare has one merge of main, ad69991a, and one branch commit, eadad7ab. The merge is clean (git diff-tree --cc is empty), so its main hunks (#2956, #2968 and the boxes egress hunks) are not ruled here. dns_gate.rs is not in the compare, so the earlier rulings stand for NET-141.

Governs: specs/networking/deployment-and-egress-gateway.md §5.3 line 145 (a name that the box's allow list does not match is refused) and §7.1 lines 254 and 264 (every hostname-routing surface, the interim :7654 proxy included, enforces the source's egress rules, and a routing surface is never a policy bypass). The spec carries these as NET-141 and NET-070 (docs/specs/18-spec-box-networking).

Ruling. The open item on cde5eaca was the production owner walk. f0dfbde8 says the walk still ran connecting_box once per waiting connection, "until the socket lookup can name a batch in one pass". So the walk's debug line ("walked /proc once") was not true on the production path. eadad7ab adds dns::connecting_boxes. It reads /proc/net/tcp{,6} once and walks /proc/*/fd once for all pairs, and Router::new now uses it (owners: Some(super::dns::connecting_boxes)). I compared it with connecting_box path by path. An unreadable table, an unreadable /proc, a socket with no holder, a holder whose pid stops holding the socket between the cgroup read and the second fd read, and holders in two boxes' leaves all give Unknown, through the same owner_of_holders. An off-node peer gives OffNode, and the non-Linux path delegates to connecting_box. In OwnerWalk::walk, a short answer list pads with Unknown, and a panicked lookup gives an empty list, so every connection is Unknown. caller_for refuses Unknown, NoLookup and an unknown box as Unattributed (403 with waiting_lookups). The gate fails closed (§7.1 line 254). The burst test now drives the production lookup over real sockets from 127.0.0.4/127.0.0.5. Those are loopback addresses, so the lookup runs and is not skipped as OffNode. The two-box case keeps a slow batch hook, and with_socket_owner clears owners so the one-by-one hook still takes effect. The batch lookup is in dns.rs, beside connecting_box and its private helpers. That is the owner of the socket lookup. The task's layers: list names only dns_gate.rs and proxy.rs, so it is narrower than the change. That is a plan note, not a design deviation, and the design says nothing about module placement inside minimald.

Residual #3000. This head does the batch lookup that #3000 asks for. So the ruling carries no residual for it. The PR body's Proof and Notes ("holds in full only when a batch lookup exists", "production looks up socket owners one connection at a time") describe cde5eaca, not this head. Close #3000 against this PR and update the body. That is housekeeping, not a design condition.

Precedent. This follows the two CONDITIONS rulings on this PR and resolves their open item. It is not a departure. The ledger keeps only the first 400 characters of each ruling, so I rebuilt the open item from the commit messages of f0dfbde8 and cde5eaca and from the PR body's own residual.

Not checked. I did not run the tests (no build). I could not check whether the burst test's < OWNER_LOOKUP_WAIT and walks <= 3 assertions hold on a loaded CI host. Both are timing assertions on the real /proc.

Ruled at eadad7a against gominimal/arch@7a86ec7bb3c0 by claude-opus-5-5; arch_rulings 895, job 3f87304c-6ec0-4d16-a592-a96563800ae9.

0