Repository navigation
fix(minvmd): withdraw a renamed own_ip box's row by its box id - #3172
Conversation
A session rename changes only the in-VM record: the VM host keeps the box's row, its creation and its published address under the name the box was registered by. The destroy then withdrew under the new name with no box id, the host refused it as another box's row, and the ingress forward, the old name's answer and the name itself stayed held for good (gominimal/inbox#1116). The destroy, `min box rm`, `min box prune` and the dashboard's destroy now present the record's box id beside the pair. The host accepts the row's own id in place of its name, finds a dormant creation by the id first (as a resume does), and releases the published address under the name the host held the box by. A withdrawal without the id is still held to the name. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An attach that ends with the session gone (the shell-exit Delete, ends_with_run, or a destroy from another shell) withdrew the row with the pair alone, under the session's current name. After a rename that is refused with NotTheCreatorsRow, and the row, its ingress forward and the old name stay (#1116). The CLI's attach and the dashboard's now read the box id off the record beside the pair, before the attach, and present it; the id still goes only with a pair. minvmd's withdrawal hands back the name the host held the box under, and the guest-audit flush after it is labelled with that name rather than the one the request presented. New tests pin box_addresses.and(box_id) on destroy_box: a pair and an id send the id; an id with no pair sends no withdrawal. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…daemon connections The lab prepush (job 05240) failed only on every_daemon_connection_is_classified: the new vm_host test fixture connects to the daemon and belongs in the inventory as ungated, like box_record_by. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
|
Approved: no findings at Nothing to do. Clobber: not checked in depth. If that was not intentional, restore the earlier change. |
agent-137
left a comment
There was a problem hiding this comment.
Review on Karl's behalf, at 1cbcf5f92. This is a comment, not an approval. Nothing was built for it: every point comes from reading the code, and each finding says how it was checked.
- CI at head
1cbcf5f92: all green. Every lane aggregator passed. - Existing reviews: CodeRabbit APPROVED at head, and a review exists on that commit. minimal-review gave COMMENT with no findings, but only 1 of 3 personas ran (correctness). Security and supply-chain did not complete, so you may want to re-trigger it with
/review. No humans have reviewed.
Should-fix: none.
Nit: none worth raising.
Checked and found fine:
withdraw_client_box_held: the id stands in for the name only when it equals the row's own id. The loopback check and theNotTheBoxIdcheck still run.- In the dormant branch the creation is looked up by id first and by name second. The
provescheck still requires the pair and a matching id. The withdrawal generation is bumped under the creation's own name. withdraw_boxreleases the answerer's address by the name the host held the box under, andflush_guest_auditkeeps its old condition (heldisSomeexactly on theAddressesreply).- On the client,
box_addresses.and(box_id)indestroy_box,cmd_box_rm,prune_host, the post-attach release and the dashboard. Record::box_idis set to the minted row id only for a box with a row (minimald/src/box_manager.rs:3650).- Open point (not a finding): the PR body says the autospawn re-registration path was not traced end to end. That is the one way a record's
box_idcould fall behind its row's, which would turn a destroy that used to pass on the pair alone into aNotTheBoxIdrefusal. I did not trace it either.
Verdict: ready to approve. Merge it before #3175.
agent-137
left a comment
There was a problem hiding this comment.
Approving at 1cbcf5f92. The earlier comment review found nothing that needs fixing, and its nits are optional.
Resolves crates/minvmd/src/box_registry.rs and control.rs: #3172 landed on main with `Record::name` returning `&str`, so this branch's rename path and its tests take a name as main does, with no borrow of the returned slice. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Part of gominimal/inbox#1116 (teardown); the rename half follows.
The bug
After
min session rename, destroying an own_ip box left its row on the VM host for good:The destroy printed the host's refusal,
NotTheCreatorsRow("the row at switch address ... is held by box "", not by the withdrawing """).Root cause
min session renameis aRenameSessionRPC to the in-VM daemon only. Nothing tells the VM host daemon, so minvmd keeps the box's row, itsCreation(persisted inbox-registry.json) and the answerer's published address under the name the box was registered by.The destroy then withdrew under the session's current name with
box_id: None(destroy_boxincrates/minimal/src/cmd/boxes/lifecycle.rs; the same formin box rm,min box pruneand the dashboard'ssettle_destroyed_box).BoxRegistry::withdraw_client_boxcompares names first, so it refused, and nothing else ever removes a creator-owned row.The session record already carries the row's id (
Record::box_id), and the resume path already finds a renamed box's creation by it (resumable_creation,resume_box_row). Only the withdrawal ignored it.The change
Host (minvmd):
withdraw_client_box(now a wrapper overwithdraw_client_box_held): when the request's box id is the row's own id, the id stands in for the name. The loopback check and the id check still run. A request with no id, or with another box's id, is still held to the name.withdraw_client_box_heldreturns the name the host held the box under.withdraw_boxincontrol.rsreleases the answerer's address under that name, not the request's (wrong after a rename), and labels the guest-audit flush with it. The info line gainsasked_as.Client (minimal):
destroy_box(session destroy, destroy-all),min box rm,min box pruneand the dashboard destroy presentrecord.box_id. The id goes only together with a pair (box_addresses.and(box_id)), so ahost_ipbox's destroy does not become a name withdrawal it never sent before.release_held_name_after_attach, frommin session attach,activate --attachand the dashboard's attach) takes the pair and the box id read off the record before the attach. Without it, a renamed session ended through an attach was refused the same way.Tests
box_registry::renamed_creator_withdraws_its_row_by_box_id: under the new name, a withdrawal without the id is refused, and so is one with another box's id. With the row's own id the row goes, the old name is returned, the creation ends and the old name registers a new box.box_registry::renamed_creator_ends_its_dormant_creation_by_box_id: the dormant case, by id and without.control::a_renamed_box_is_withdrawn_by_its_id_and_released_by_its_old_name: over the control socket, the answerer's release goes by the old name.vm_host::a_destroy_withdraws_its_row_by_pair_and_box_idandvm_host::a_destroy_with_a_box_id_but_no_pair_withdraws_nothingdrivedestroy_boxagainst a stand-in VM host control server.vm_host::an_attach_that_ends_with_the_session_gone_withdraws_its_rowanddash::rpc::tui_destroy_withdraws_box_rownow assert the id is sent. The new fixture is listed inevery_daemon_connection_is_classified.Scope and review points
NotTheBoxIdon destroys that used to go by the pair alone. The record's id is the one the resume and the in-VM row check already rely on; the autospawn re-registration path was not traced end to end.Verification
OK: 841-rename-own-ip-1cbcf5f9: 4 expectation(s) on ubuntu-24.04, fedora: 841-rename-destroy-own-ip-row:fail->pass 727-host-ip-egress-fail-open:pass 790d-own-ip-ingress-diagnose-vm:same 723-vm-host-ip-name-502:same
min-regress batch
841-rename-own-ip-1cbcf5f9: baserel-6a01d5aevs the candidatecand-841-rename-own-ip-1cbcf5f9-b6ec7fdc, per distro:Lab evidence (min-regress batch
841-rename-own-ip-1cbcf5f9on the lab box, fedora, ubuntu-24.04)Head:
1cbcf5f925da5a29f2ca43e67979ef8196d3f340at 1cbcf5f (lab namecand-841-rename-own-ip-1cbcf5f9-b6ec7fdc). Base:rel-6a01d5ae(rel-6a01d5ae).session policybut never enforced (fail-open)session policybut never enforced (fail-open)Fixed since base: 2. Still reproducing on both: 2. Regressed: 0. Passing on both: 4. A scenario that fails on both sides is the environment or main, not this candidate: read its evidence lines before reading it as the candidate's. A verdict links to the run's trace in Cloud Trace (project access needed); the scenario link is its source with the
# issue:it reproduces.Why each failed run failed: what the scenario measured, then what its trace recorded (error spans and warnings, most frequent first):
destroy_warn=1 port_listening=1 old_name_answer=127.0.64.3 reactivate_rc=2 already_exists=1 destroy_rc=0 registry_names_old=1 answer_before=127.0.64.3 port_before=1; trace:2x minimal-cli span error cmd;1x minimal-cli span error activation_stepdestroy_warn=1 port_listening=1 old_name_answer=127.0.64.3 reactivate_rc=2 already_exists=1 destroy_rc=0 registry_names_old=1 answer_before=127.0.64.3 port_before=1; trace:2x minimal-cli span error cmd;1x minimal-cli span error activation_stepbody_bytes=1000 curl_rc=0 cli_addr_bytes=0 cli_name_bytes=0 inbox_bytes=1060 web_ip=100.64.127.255 tcpdump=no syn=0 synack=0 rst=0; trace:3x minimald WARN exec: ended while its command was starting; the start is ended when it returns;1x minimald WARN the box's classifier cover fell back to an empty read-only tmpfs: the kernel refused the design's cgroup<n> mount of the box's namespace roo;1x minimald WARN exec: ssh client disconnected; killing childbody_bytes=1000 curl_rc=0 cli_addr_bytes=0 cli_name_bytes=0 inbox_bytes=1060 web_ip=100.64.127.255 tcpdump=no syn=0 synack=0 rst=0; trace:3x minimald WARN exec: ended while its command was starting; the start is ended when it returns;1x minimald WARN the box's classifier cover fell back to an empty read-only tmpfs: the kernel refused the design's cgroup<n> mount of the box's namespace roo;1x minimald WARN exec: ssh client disconnected; killing childdestroy_warn=1 port_listening=1 old_name_answer=127.0.64.3 reactivate_rc=2 already_exists=1 destroy_rc=0 registry_names_old=1 answer_before=127.0.64.3 port_before=1; trace:2x minimal-cli span error cmd;1x minimal-cli span error activation_stepdestroy_warn=1 port_listening=1 old_name_answer=127.0.64.3 reactivate_rc=2 already_exists=1 destroy_rc=0 registry_names_old=1 answer_before=127.0.64.3 port_before=1; trace:2x minimal-cli span error cmd;1x minimal-cli span error activation_stepbody_bytes=1000 curl_rc=0 cli_addr_bytes=0 cli_name_bytes=0 inbox_bytes=1060 web_ip=100.64.127.255 tcpdump=no syn=0 synack=0 rst=0; trace:3x minimald WARN exec: ended while its command was starting; the start is ended when it returns;1x minimald WARN the box's classifier cover fell back to an empty read-only tmpfs: the kernel refused the design's cgroup<n> mount of the box's namespace roo;1x minimald WARN exec: ssh client disconnected; killing childbody_bytes=1000 curl_rc=0 cli_addr_bytes=0 cli_name_bytes=0 inbox_bytes=1060 web_ip=100.64.127.255 tcpdump=no syn=0 synack=0 rst=0; trace:3x minimald WARN exec: ended while its command was starting; the start is ended when it returns;1x minimald WARN the box's classifier cover fell back to an empty read-only tmpfs: the kernel refused the design's cgroup<n> mount of the box's namespace roo;1x minimald WARN exec: ssh client disconnected; killing childEach cited run's verdict and evidence
Each cited run's last VERDICT or ENV line and its EVIDENCE line (the results.jsonl rows of batch
841-rename-own-ip-1cbcf5f9):VERDICT: after rename a841x18687 -> b841x18687 and destroy, left behind: ingress-port-38687 old-name-answers-127.0.64.3 reactivation-refused (destroy warned: 1);EVIDENCE: destroy_warn=1 port_listening=1 old_name_answer=127.0.64.3 reactivate_rc=2 already_exists=1 destroy_rc=0 registry_names_old=1 answer_before=127.0.64.3 port_before=1VERDICT: after rename a841x26269 -> b841x26269 and destroy, left behind: ingress-port-26269 old-name-answers-127.0.64.3 reactivation-refused (destroy warned: 1);EVIDENCE: destroy_warn=1 port_listening=1 old_name_answer=127.0.64.3 reactivate_rc=2 already_exists=1 destroy_rc=0 registry_names_old=1 answer_before=127.0.64.3 port_before=1VERDICT: rename then destroy left nothing behind: port 38251 closed, a841x18251 answers nxdomain, re-activation under a841x18251 succeeded;EVIDENCE: destroy_warn=0 port_listening=0 old_name_answer=nxdomain reactivate_rc=0 already_exists=0 destroy_rc=0 registry_names_old=0 answer_before=127.0.64.3 port_before=1VERDICT: rename then destroy left nothing behind: port 39711 closed, a841x19711 answers nxdomain, re-activation under a841x19711 succeeded;EVIDENCE: destroy_warn=0 port_listening=0 old_name_answer=nxdomain reactivate_rc=0 already_exists=0 destroy_rc=0 registry_names_old=0 answer_before=127.0.64.3 port_before=1VERDICT: after rename a841x32228 -> b841x32228 and destroy, left behind: ingress-port-32228 old-name-answers-127.0.64.3 reactivation-refused (destroy warned: 1);EVIDENCE: destroy_warn=1 port_listening=1 old_name_answer=127.0.64.3 reactivate_rc=2 already_exists=1 destroy_rc=0 registry_names_old=1 answer_before=127.0.64.3 port_before=1VERDICT: after rename a841x41552 -> b841x41552 and destroy, left behind: ingress-port-21552 old-name-answers-127.0.64.3 reactivation-refused (destroy warned: 1);EVIDENCE: destroy_warn=1 port_listening=1 old_name_answer=127.0.64.3 reactivate_rc=2 already_exists=1 destroy_rc=0 registry_names_old=1 answer_before=127.0.64.3 port_before=1VERDICT: rename then destroy left nothing behind: port 30446 closed, a841x10446 answers nxdomain, re-activation under a841x10446 succeeded;EVIDENCE: destroy_warn=0 port_listening=0 old_name_answer=nxdomain reactivate_rc=0 already_exists=0 destroy_rc=0 registry_names_old=0 answer_before=127.0.64.3 port_before=1VERDICT: rename then destroy left nothing behind: port 38450 closed, a841x18450 answers nxdomain, re-activation under a841x18450 succeeded;EVIDENCE: destroy_warn=0 port_listening=0 old_name_answer=nxdomain reactivate_rc=0 already_exists=0 destroy_rc=0 registry_names_old=0 answer_before=127.0.64.3 port_before=1VERDICT: host_ip: allow-list refused up front; deny-all egress is enforced (1.1.1.1:443 blocked); no EVIDENCE lineVERDICT: host_ip: allow-list refused up front; deny-all egress is enforced (1.1.1.1:443 blocked); no EVIDENCE lineVERDICT: host_ip: allow-list refused up front; deny-all egress is enforced (1.1.1.1:443 blocked); no EVIDENCE lineVERDICT: host_ip: allow-list refused up front; deny-all egress is enforced (1.1.1.1:443 blocked); no EVIDENCE lineVERDICT: own_ip ingress delivers to the host but a box's half-closing client loses the reply: cli -> web by address 0 B, cli -> web by name 0 B;EVIDENCE: body_bytes=1000 curl_rc=0 cli_addr_bytes=0 cli_name_bytes=0 inbox_bytes=1060 web_ip=100.64.127.255 tcpdump=no syn=0 synack=0 rst=0VERDICT: own_ip ingress delivers to the host but a box's half-closing client loses the reply: cli -> web by address 0 B, cli -> web by name 0 B;EVIDENCE: body_bytes=1000 curl_rc=0 cli_addr_bytes=0 cli_name_bytes=0 inbox_bytes=1060 web_ip=100.64.127.255 tcpdump=no syn=0 synack=0 rst=0VERDICT: own_ip ingress delivers to the host but a box's half-closing client loses the reply: cli -> web by address 0 B, cli -> web by name 0 B;EVIDENCE: body_bytes=1000 curl_rc=0 cli_addr_bytes=0 cli_name_bytes=0 inbox_bytes=1060 web_ip=100.64.127.255 tcpdump=no syn=0 synack=0 rst=0VERDICT: own_ip ingress delivers to the host but a box's half-closing client loses the reply: cli -> web by address 0 B, cli -> web by name 0 B;EVIDENCE: body_bytes=1000 curl_rc=0 cli_addr_bytes=0 cli_name_bytes=0 inbox_bytes=1060 web_ip=100.64.127.255 tcpdump=no syn=0 synack=0 rst=0VERDICT: the session name reaches its 0.0.0.0 dev server through the proxy and a 127.0.0.1-only port is refused naming the fix (ok: local.min.internal min.internal);EVIDENCE: min.internal loopback-only :P -> GET 403 The box listens on this port at 127.0.0.1 only. Bind it to 0.0.0.0 to reach it by name. | 0.0.0.0 :Q -> GET 200 WILD-41637VERDICT: the session name reaches its 0.0.0.0 dev server through the proxy and a 127.0.0.1-only port is refused naming the fix (ok: local.min.internal min.internal);EVIDENCE: min.internal loopback-only :P -> GET 403 The box listens on this port at 127.0.0.1 only. Bind it to 0.0.0.0 to reach it by name. | 0.0.0.0 :Q -> GET 200 WILD-32551VERDICT: the session name reaches its 0.0.0.0 dev server through the proxy and a 127.0.0.1-only port is refused naming the fix (ok: local.min.internal min.internal);EVIDENCE: min.internal loopback-only :P -> GET 403 The box listens on this port at 127.0.0.1 only. Bind it to 0.0.0.0 to reach it by name. | 0.0.0.0 :Q -> GET 200 WILD-19681VERDICT: the session name reaches its 0.0.0.0 dev server through the proxy and a 127.0.0.1-only port is refused naming the fix (ok: local.min.internal min.internal);EVIDENCE: min.internal loopback-only :P -> GET 403 The box listens on this port at 127.0.0.1 only. Bind it to 0.0.0.0 to reach it by name. | 0.0.0.0 :Q -> GET 200 WILD-38750🤖 Generated with Claude Code
Summary by CodeRabbit