What happens to one VM's hand-off socket, from its creation to its end?
Decided 2026-11-11: A. The decision is in the I754I754 (closed): S07-05-stream-hand-off and S04: settle the hand-off contract end to end (descriptor passing, acks, identity, close, restarts, audit)The hand-off of sockets and streams between host processes keeps getting patched one review at a time: comment that starts Decision (2026-11-11): A. Source: I754I754 (closed): S07-05-stream-hand-off and S04: settle the hand-off contract end to end (descriptor passing, acks, identity, close, restarts, audit)The hand-off of sockets and streams between host processes keeps getting patched one review at a time:. Adds S04-12-descriptor-passingS04-12-descriptor-passing: Passing DescriptorsHow one host process passes an open socket to another: who holds it when, how the receiver shows it holds it, when the sender closes its copy, and what a lost or bad acknowledgment does., S07-20-handoff-socketsS07-20-handoff-sockets: Hand-off SocketsThe life of one VM's hand-off socket: its identity, the acknowledgments of both ends, how it closes, who a failure is charged to, what each restart does to it, and which of its decisions reach the audit log. and S07-21-vm-endS07-21-vm-end: A VM's End in wb-proxydHow wb-hostd ends a VM's hand-off sockets in the one wb-proxyd, and how the VM's last event records reach its stop record without one VM's stop or backlog taking the other VM's network down., and changes S07-05-stream-hand-offS07-05-stream-hand-off: Stream Hand-offHow wb-netd hands each stream to wb-proxyd, and the checks that keep a compromised wb-netd from widening what a stream may reach., S07-06-name-mappingS07-06-name-mapping: Name MappingHow wb-proxyd keeps its own checked copy of the names wb-netd gave synthetic addresses: name reports, releases, replay, lifetime, the second count of the wildcard budget, and the copy wb-hostd keeps., S04-07-supervisionS04-07-supervision: SupervisionWho starts and restarts each host process, what happens when wb-hostd stops or the bundle is upgraded, and daemon outages., S04-08-records-and-boundsS04-08-records-and-bounds: Records, Versions and BoundsThe records daemons send wb-hostd, the build version rules between processes, the bounds on host work a guest can cause, and logs., S04-09-netd-startS04-09-netd-start: Starting `wb-netd`How wb-hostd starts and stops each VM's wb-netd, what the program inherits, its profile, and what it does before its start message., S04-02-vm-providerS04-02-vm-provider: VM Provider and StreamsHow wb-vmd hands guest connections and the NIC endpoint to other processes, the fixed device set of a VM, and where wb-proxyd takes a stream's identity from., S09-11-auditS09-11-audit: AuditWhat the audit log records, the budgets that bound it, and what happens when the log can't be written. and T14-shared-proxydT14-shared-proxyd: One proxy process serves both VMsOne wb-proxyd serves the work VM and the isolated VM (S04-architecture, "Processes").. It builds on the decisions of I728I728 (closed): Hand-off socket contract of S07-20: socket number, HandoffSocketHeld, states, close reports, and a VM's endBuilds the hand-off socket contract of S07-20-handoff-sockets and the end exchange of S07-21-vm-end (#754, PR #758) in one change, before #480. and I729I729 (closed): wb-netd can't acknowledge that it holds its end of the hand-off socketFollow-up from the security review of #727 (F2), for #637. (2026-11-10), I571I571 (closed): egress contract: HandoffSocketClosed rule for a StreamReset that can't be sentPR #570 (#491) added a rule to S07-05-stream-hand-off, "Resets": when a StreamReset send fails (ENOBUFS or past its deadline), wb-proxyd closes the VM's hand-off socket before the stream's socket, and wb-netd resets…’s triage (2026-11-10), I576I576 (closed): wb-proxyd: one VM's failed hand-off socket ends the control channel for every VMIn wb-proxyd's hand-off receiver (#492, PR #574), a failure on one VM's new hand-off socket ends the whole control channel, and with it every VM's sockets and streams. (2026-11-07) and I512I512 (closed): wb-proxyd: the program, its confinement and start, hand-off sockets per VM, and restartsPackage M3.12 of docs/implementation-plan.md, part 3 of 4 (M3.12c)., decision 4.
Figure 1. One VM’s hand-off socket, with the new number and acknowledgments. The red arrow is the report option A adds: today wb-proxyd closes a socket for an unsent reset or a peer that closed its end without telling wb-hostd. S07-20-handoff-socketsS07-20-handoff-sockets: Hand-off SocketsThe life of one VM's hand-off socket: its identity, the acknowledgments of both ends, how it closes, who a failure is charged to, what each restart does to it, and which of its decisions reach the audit log. has the full sequence.
Options
Section titled “Options”These are what a failure on a VM’s hand-off socket does once wb-proxyd has accepted it: wb-netd closed its end, a receive failed, the version record couldn’t be sent, or a StreamReset couldn’t be sent. A fault in wb-hostd’s own message still ends the control channel in each option, as you decided in I576I576 (closed): wb-proxyd: one VM's failed hand-off socket ends the control channel for every VMIn wb-proxyd's hand-off receiver (#492, PR #574), a failure on one VM's new hand-off socket ends the whole control channel, and with it every VM's sockets and streams..
The case for B. It is the smallest rule: any trouble on the control side ends wb-proxyd, and the supervisor restarts it. Each VM then gets a new socket, so no state is kept past a fault, and there is nothing to number or match. Until V1-M6-release-gateV1-M6-release-gate: Release gateThe Seatbelt profiles of wb-hostd and the sessions, confinement self-checks, warm start and suspend, the full conformance suite and benchmarks, packaging and upgrades. there are no restarts, so A and B both stop VMs. A only stops fewer of them.
Confidence: high. The reviews found failures that come from wb-proxyd or the host and would have charged a wb-netd: an ack-timeout, a receive that fails with an error, and a version record that can’t be sent. S07-20-handoff-socketsS07-20-handoff-sockets: Hand-off SocketsThe life of one VM's hand-off socket: its identity, the acknowledgments of both ends, how it closes, who a failure is charged to, what each restart does to it, and which of its decisions reach the audit log. (“Who a failure is charged to”) now charges these to wb-proxyd. A StreamReset that wb-netd refuses is a bug in wb-proxyd too.
Impact
Section titled “Impact”| Requirement | A. Report, end wb-netd | B. End wb-proxyd | C. Close silently |
|---|---|---|---|
| SEC08-proj-isolationSEC08-proj-isolation: Per-project isolationEach project has its own guest user, state and history, and one project cannot persist into another. one project can’t reach another’s grants | VM from the socket | VM from the socket | VM from the socket |
| SEC10-auditSEC10-audit: AuditEvery egress decision, approval, and returned change is recorded on the host in a persisted log the guest cannot alter. every egress decision recorded on the host | rule in the record | exit recorded | no record |
| SEC13-bounded-resourcesSEC13-bounded-resources: Bounded resourcesCPU, memory and disk of each VM are capped. limits per VM | one VM pays | both VMs pay | one VM pays |
| T14-shared-proxydT14-shared-proxyd: One proxy process serves both VMsOne wb-proxyd serves the work VM and the isolated VM (S04-architecture, "Processes"). one VM’s fault in the shared proxy | contained | spreads | contained |
Evidence
Section titled “Evidence”- verified
wb-proxydcloses a VM’s socket when aStreamResetcan’t be sent, and logs onlystream-reset-failed. Source:internal/proxyd/handoff/socket.go:439-453. - verified
HandoffSocketClosedtakes only the rulename-report-malformed. Source:internal/egressmsg/control.go:10,control.proto. - verified A version record that
wb-proxydcan’t send on a new socket ends its control channel for every VM. Source:internal/proxyd/handoff/receiver.go:303. - verified
wb-netdalready resets a stream whose guest takes no bytes for 60 s (guest-write-timeout), so I536I536 (closed): wb-proxyd: bound writes to a stream's socket (stream-write-timeout) and close upstream when it endsBuilds S07-20-handoff-sockets, "Stream bounds", on wb-proxyd's side (#754, PR #758).’s zero-window guest is bounded on that side. What’s left is a bound inwb-proxydfor awb-netdthat stops reading. Source:internal/netd/handoff/stream.go:21-25, since I647I647 (closed): wb-netd: keep a handed-off stream's end open until wb-proxyd holds it (macOS socket GC)wb-netd closes the stream end it hands to wb-proxyd right after the send: internal/netd/handoff/stream.go:98 (defer theirs.Close()), as the comment on StreamPair (internal/platform/fdchan/fdchan_darwin.go, around line…. - verified
wb-netd’s hand-off sender records with no event channel, so its refusals miss the audit log. Source:internal/netd/handoff/sender.go:107, I730I730 (closed): wb-netd's hand-off refusals never reach the audit log (Sender has no Events)Builds S07-20-handoff-sockets, "Audit", for wb-netd (#754, PR #758).. - verified
wb-vmd’s acknowledgment reader stops at the firstrecvmsgerror or cut control data. Source:Sources/WraithBoxVMD/HandoffKeeper.swift:199, I751I751 (closed): wb-vmd: a bad hand-off ack or failed receive is skipped, not the end of the ack readerBuilds S04-12-descriptor-passing, "Acknowledgments are input", in wb-vmd's acknowledgment reader (#754, PR #758).. - inferred The flaky test of I731I731 (closed): wb-netd TestChildServes: the test's handoff() closes its copy of the passed socket at once (flaky on macOS 27)Fix the test helper that breaks S04-12-descriptor-passing's keep rule (#754, PR #758). closes the end it passed to
wb-netdat once, which the keep-until-held rule forbids. Source:cmd/wb-netd/child_darwin_test.go:229-237. - verified An answer to the VM’s end that waited on the event channel could be late, and a record queued before it could name a stopped VM. Either ends the shared
wb-proxyd. Source: security review of PR758PR758 (merged): docs(spec): settle the hand-off contract end to endThe rules for passing open sockets between the host daemons, and for the life of each VM's hand-off socket, now each have one place in the spec., F1, withTestProxydNamesStoppedVMandTestProxydHoldEndsWithTheVM. So S07-21-vm-endS07-21-vm-end: A VM's End in wb-proxydHow wb-hostd ends a VM's hand-off sockets in the one wb-proxyd, and how the VM's last event records reach its stop record without one VM's stop or backlog taking the other VM's network down. haswb-proxydanswer without waiting on delivery, and name its last record. - assumed An honest
wb-proxydcloses a VM’s sockets and streams and queues its records within the acknowledgment deadline. I512I512 (closed): wb-proxyd: the program, its confinement and start, hand-off sockets per VM, and restartsPackage M3.12 of docs/implementation-plan.md, part 3 of 4 (M3.12c).’s tests measure it.
Also in the spec change
Section titled “Also in the spec change”Approving the brief approves these too.
- The rule for passing a socket, in one place (S04-12-descriptor-passingS04-12-descriptor-passing: Passing DescriptorsHow one host process passes an open socket to another: who holds it when, how the receiver shows it holds it, when the sender closes its copy, and what a lost or bad acknowledgment does.). A sender keeps its copy until the receiver shows it holds it, for every leg, with the proof and the bound per leg. Pipes and descriptors inherited at spawn are exempt.
- A bad acknowledgment is skipped. A lost one runs to its bound. A wrong, duplicate or late one is refused and the reader goes on. A reader of acknowledgments only ends when its peer closes, on cut control data, whose descriptors it can’t name, or after a run of failed receives (I751I751 (closed): wb-vmd: a bad hand-off ack or failed receive is skipped, not the end of the ack readerBuilds S04-12-descriptor-passing, "Acknowledgments are input", in wb-vmd's acknowledgment reader (#754, PR #758).).
- States of a socket (S07-20-handoff-socketsS07-20-handoff-sockets: Hand-off SocketsThe life of one VM's hand-off socket: its identity, the acknowledgments of both ends, how it closes, who a failure is charged to, what each restart does to it, and which of its decisions reach the audit log.): offered, acknowledged, serving, and four final states.
wb-hostdholds its copies to each deadline. - The socket number and
HandoffSocketHeld, as you decided in I728I728 (closed): Hand-off socket contract of S07-20: socket number, HandoffSocketHeld, states, close reports, and a VM's endBuilds the hand-off socket contract of S07-20-handoff-sockets and the end exchange of S07-21-vm-end (#754, PR #758) in one change, before #480. and I729I729 (closed): wb-netd can't acknowledge that it holds its end of the hand-off socketFollow-up from the security review of #727 (F2), for #637..HandoffSocketHelddoesn’t name the VM, becausewb-netd’s channel is its VM’s. - A VM’s end is its own exchange (S07-21-vm-endS07-21-vm-end: A VM's End in wb-proxydHow wb-hostd ends a VM's hand-off sockets in the one wb-proxyd, and how the VM's last event records reach its stop record without one VM's stop or backlog taking the other VM's network down.).
wb-hostdsendsHandoffSocketEndbefore it stopswb-netd, naming the highest socket number it offered. It is valid from any socket state, a refused start included, and its answer is never stale. A socket end and a stop end have their own waits, keyed with the stop flag. The answer nameswb-proxyd’s last event record for the VM, andwb-hostdends the VM’s events only after reading up to it, under the stop allowance. The end’s records may passwb-proxyd’s queue cap by a bound the per-VM caps give, and after the answer it queues none for the VM. No answer by the deadline endswb-proxyd(handoff-end-timeout), an exit ofwb-proxydends every wait sent to it, and lost records are recorded (proxyd-records-lost). - Who a failure is charged to. Failures a guest can cause end that VM’s
wb-netd(handoff-netd-ended). Failures ofwb-proxydor the host endwb-proxyd(handoff-proxyd-ended), never charging awb-netd.wb-proxydrefuses to start unless its descriptor limit covers every descriptor thewb-netds can make it hold at once. - Stream bounds.
wb-proxydgets a write deadline longer thanwb-netd’s guest bound (stream-write-timeout). A stream where neither side sends is bounded by the caps, not by time. - Audit. A table of which rule each process records, and which stay in the daemon log. A reader keys on the record’s
senderand rule together.
Open points
Section titled “Open points”- Enforce the audit table.
wb-hostdchecks only a rule’s form, so a compromisedwb-netdcan write records about its own VM under another process’s rule name.senderis stamped from the channel, so none is forged under another sender. The spec has readers key on both. Whetherwb-hostdalso refuses a rule outside the sender’s row is yours to decide (security review of PR758PR758 (merged): docs(spec): settle the hand-off contract end to endThe rules for passing open sockets between the host daemons, and for the life of each VM's hand-off socket, now each have one place in the spec., F7). - I741I741 (closed): Audit event holds: one VM's budget can hold the shared wb-proxyd channel for every VMFollow-up from the reviews of #740 (#541): code review F3, security review F1.. Whether one VM’s audit budget may hold
wb-proxyd’s event channel for the other VM stays open. The end of S07-21-vm-endS07-21-vm-end: A VM's End in wb-proxydHow wb-hostd ends a VM's hand-off sockets in the one wb-proxyd, and how the VM's last event records reach its stop record without one VM's stop or backlog taking the other VM's network down. holds under either outcome. With the hold,wb-proxydqueues the end’s records past its cap andwb-hostdreads past the hold under the stop allowance. Without it, nothing holds.
What this unblocks
Section titled “What this unblocks”- I728I728 (closed): Hand-off socket contract of S07-20: socket number, HandoffSocketHeld, states, close reports, and a VM's endBuilds the hand-off socket contract of S07-20-handoff-sockets and the end exchange of S07-21-vm-end (#754, PR #758) in one change, before #480. (the contract change, with I571I571 (closed): egress contract: HandoffSocketClosed rule for a StreamReset that can't be sentPR #570 (#491) added a rule to S07-05-stream-hand-off, "Resets": when a StreamReset send fails (ENOBUFS or past its deadline), wb-proxyd closes the VM's hand-off socket before the stream's socket, and wb-netd resets… folded in), then I512I512 (closed): wb-proxyd: the program, its confinement and start, hand-off sockets per VM, and restartsPackage M3.12 of docs/implementation-plan.md, part 3 of 4 (M3.12c). (the VM stop wiring and the event window) and I513I513 (open): Egress in a VM: the network floor's conformance cases with wb-netd and wb-proxyd, on a team-signed buildPackage M3.12 of docs/implementation-plan.md, part 4 of 4 (M3.12d)., the exit of V1-M3-network-floorV1-M3-network-floor: The network floorwb-netd and wb-proxyd in inspect mode with a static policy, the audit log, and the conformance cases for egress..
- I536I536 (closed): wb-proxyd: bound writes to a stream's socket (stream-write-timeout) and close upstream when it endsBuilds S07-20-handoff-sockets, "Stream bounds", on wb-proxyd's side (#754, PR #758)., I730I730 (closed): wb-netd's hand-off refusals never reach the audit log (Sender has no Events)Builds S07-20-handoff-sockets, "Audit", for wb-netd (#754, PR #758). and I751I751 (closed): wb-vmd: a bad hand-off ack or failed receive is skipped, not the end of the ack readerBuilds S04-12-descriptor-passing, "Acknowledgments are input", in wb-vmd's acknowledgment reader (#754, PR #758)., rewritten to build named sections.
Details and glossary
Why the number. A wb-netd restart gives a VM a new socket in the same generation. Without a number, a late notice about the old socket can end the new wb-netd, or fail its start with a false cause (I728I728 (closed): Hand-off socket contract of S07-20: socket number, HandoffSocketHeld, states, close reports, and a VM's endBuilds the hand-off socket contract of S07-20-handoff-sockets and the end exchange of S07-21-vm-end (#754, PR #758) in one change, before #480.).
Why the strict side for an unsent reset. A guest that stops reading while wb-netd lags can fill the socket, so it can cause one. Counting the restart keeps a guest from looping it for free (I571I571 (closed): egress contract: HandoffSocketClosed rule for a StreamReset that can't be sentPR #570 (#491) added a rule to S07-05-stream-hand-off, "Resets": when a StreamReset send fails (ENOBUFS or past its deadline), wb-proxyd closes the VM's hand-off socket before the stream's socket, and wb-netd resets…’s triage).
Glossary
- Hand-off socket: the socketpair that carries one VM’s streams and name reports from its
wb-netdtowb-proxyd. SCM_RIGHTS: the way one process sends an open socket to another over a Unix socket.- Generation: a number for one run of a VM. Each start or restore raises it.
- Acknowledgment: a message from the receiver that says it holds what it was sent.