Skip to content

S06-10 - Leftover Processes

Purpose: The results of the kill of a project user, how wb-hostd accepts them, and what it does when processes are left.

The kill loop of S13-01-process-hardeningS13-01-process-hardening: Layer 1: Process Hardening (v1)How wb-guestd hardens every process it starts for a project user, and how it stops and kills a project user's processes. ends clean, or with a count of processes left.

wb-hostd sends a kill of a project user in two cases:

  • when it ends a project’s last session in the VM;
  • at the first connection, for users with no lost session. It sends that kill only after it has answered the reconnect list.

Each kill carries a kill ID that wb-hostd assigns. For each one, wb-guestd writes a cleanup record to its root-owned directory, with:

  • the kill ID;
  • the project ID;
  • the result: clean, or the count of processes left, capped at 1001.

It keeps the record until wb-hostd acknowledges it, and lists it at reconnect (S06-11-reconnect-and-recoveryS06-11-reconnect-and-recovery: Reconnect, Loss and RecoveryWhat happens when the host-guest link drops, when a session is lost, and how a lost session's work is recovered or discarded., “Reconnect”).

It holds at most one record per project user in the VM, counted apart from the 64 session entries. A newer record replaces an older one of the same user. The replaced kill then fails closed at its deadline.

The loop can run because a session’s client went and no session of that user is left. The result is then the cleanup field of that session’s report (S06-09-session-lifecycleS06-09-session-lifecycle: Session LifecycleA session's states from wb claude to its summary, how it starts and ends, its deadlines, and when its VM may be saved., “Ending”).

wb-hostd accepts a result only when all of these hold:

Anything else is dropped, and logged with its rule.

A kill without an accepted clean result by its deadline counts as a result of processes left. A late, missing, or dropped result never counts as clean.

wb-hostd keeps its pending kills in memory, not in state.db. A wb-hostd exit stops every VM. A pending kill then closes either way.

A pending kill whose VM generation ends in a cold stop before its deadline is closed instead, because the guest it targeted no longer runs. A cold stop is a stop that wb-vmd reports for any reason:

  • guest shutdown and panic included;
  • wb vm stop;
  • a wb-hostd exit;
  • the cold boot of an upgrade.

An in-place reboot of the guest isn’t a cold stop.

A stop the guest forces is safe, because a running generation has no saved state, and suspend is refused while a kill is pending (S06-09-session-lifecycleS06-09-session-lifecycle: Session LifecycleA session's states from wb claude to its summary, how it starts and ends, its deadlines, and when its VM may be saved., “Idle suspend”).

wb-hostd logs each kill a cold stop closes, with its rule and the stop’s cause (SEC10-auditSEC10-audit: AuditEvery egress decision, approval, and returned change is recorded on the host in a persisted log the guest cannot alter.).

The refusals below belong to the VM generation that produced them. A cold boot starts a new generation without them.

For a result of processes left, wb-hostd:

Only a cold boot clears the refusals, never a suspend and restore.

Guest root can fake a result or hold it back.

Status: Draft