Skip to content

Fd hygiene

A process inherits open file descriptors from its parent, and an inherited descriptor is authority: a registry connection, a control-plane transport or the socket that issues the runtime's identity. The kernel therefore decides descriptor inheritance explicitly for every cell. Descriptors are denied by default, and one descriptor is delivered to a provider only when the sealed containment profile authorises that exact descriptor. This page covers the default, the workload-API descriptor, and the conditions that refuse a launch.

What crosses into a cell

flowchart LR
  subgraph PARENT["HOST AND MONITOR DESCRIPTORS"]
    direction TB
    STD["stdin, stdout, stderr"]
    WL["Workload-API descriptor"]
    OTH["Every other descriptor:<br/>registry, control-plane transport, host files"]
  end
  GATE{{"Descriptor allowlist<br/>from the sealed containment profile"}}
  subgraph CELL["PROVIDER PROCESS"]
    direction TB
    IN["Handled explicitly"]
    API["Delivered at the named number,<br/>when authorised"]
  end
  CLOSED["Closed at exec<br/>CLOEXEC"]
  STD --> GATE
  WL --> GATE
  OTH --> GATE
  GATE --> IN
  GATE --> API
  GATE --> CLOSED

Standard input, output and error are handled explicitly. Every other open descriptor carries CLOEXEC and is closed when the provider is executed. The single exception is the workload-API descriptor, and only when the profile's workload-API socket policy names it.

The workload-API descriptor

The workload-API socket issues the runtime's workload identity. The containment profile's workload-API socket policy is either denied, which gives the provider neither the socket nor a descriptor for it, or allowed at one named descriptor number, which delivers the descriptor across exec at that number.

Socket reachability and descriptor inheritance are separate decisions. A monitor or host that can reach a socket gives the provider no access to it: the provider holds a descriptor only through the allowlist. The nucleus host is the one process of the chain that holds a workload identity. See Workload identity across the process topology.

When a launch is refused

Condition Outcome
The authorised descriptor is closed at launch Refused: a descriptor number was named and nothing was delivered
The authorised descriptor carries CLOEXEC Refused: it would close at exec
An inherited descriptor without CLOEXEC that the profile does not authorise Containment failure; the provider is not started

Each refusal is an effect failure returned to the nucleus, and the cell stays out of ready.