Resource domains and branded zones

Native enforcement

The zone manager is a userspace service inspired by illumos zones and BrandZ. It controls configuration, boot, halt, destruction, and administrative access. Adapt zonecfg, zoneadm, zlogin, and suitable zoneadmd interfaces to native services. Each zone has process, mount, device, and capability namespaces, a resource domain, and optional network isolation. Hierarchical zones can borrow jail concepts where practical. A child can receive only authority available to its parent.

A Capsicum-inspired application sandbox restricts ambient authority and delegates only authorized descriptor operations. Descriptor rights are enforced by the service responsible for each object and composed with native kernel capabilities. Support process ASLR and KASLR, each configurable independently of the build mode. Default to enabled in release and disabled in debug builds.

Process tracing follows the target’s credential and zone policy. Attach and wait-event access are confined to the caller’s zone unless the zone manager explicitly authorizes cross-zone debugging of the target. Resolve PIDs in the authorized namespace and bind each tracing session to the target process object. Recheck or revoke authority when credentials or zone membership change. See Application debugging with ptrace.

Resource domain controls

Use one native tree of resource domains for process groups and zones. An authorized administrator can create a child, attach processes, delegate control within the parent’s bounds, set limits, and read usage and throttle counters. Children inherit domain membership at process creation. Moving a process changes the membership of its threads together. Keep the resource-domain identity separate from the POSIX job control process group.

Implement the following controls while the kernel still uses the single-level dispatch described in Scheduling and CPU accounting:

Resource

Enforcement

CPU placement and time

The kernel intersects each thread’s affinity with the requested and inherited CPU sets and currently online CPUs. Report requested and effective sets separately. A child can narrow its parent’s placement. An empty effective set makes its threads ineligible. Charge executed CPU time to the domain and each ancestor. A CPU time quota limits runtime per period and throttles eligible work until replenishment. Deadline reservations must fit those same bounds.

Memory and swap

VM accounts for resident pages, wired and pinned memory, and swap by domain. Give shared pages an explicit accounting owner so mapping the same frame more than once keeps its physical charge consistent. Apply reclaim pressure within the domain at its high threshold and deny allocations at the hard limit when reclaim cannot make room. Keep the protected page-in and recovery reserves available.

Disk I/O

The storage service enforces per-device read and write byte and operation rates. Apply limits at admission to the device queue and account for actual work, including delayed filesystem writeback. Use I/O weights to choose among eligible queues under contention. Charge a request to its origin and enforce the ancestor ceilings.

The kernel authenticates the accounting context for native calls. Shared services carry that context through asynchronous work, IPC, and storage submission, so a domain cannot evade limits through a shared provider. Bind accepted work to its charging domain until completion or cancellation. Apply new membership to future requests and preserve existing charges when a process moves. Kernel, VM, and device-owning services enforce limits at their respective resource boundaries. The userspace administration service manages policy and exposes usage, reclaim, and throttling events.

Stage 2.6 establishes inherited controls and accounting. Later hierarchical CPU dispatch uses these domains to grant CPU time to groups and run different policies inside them. The Linux personality presents compatible cgroup v2 controls backed by the same native enforcement and delegated authority. See Foreign executable and application ABIs.

See also

Linux cgroup v2.

Mount namespaces and local files

Each zone has its own root and mount namespace. The root can be a directory tree, a dataset, or a native VFS mount. A Linux process sees its zone’s root as /. Its /usr, /etc, and compatible /proc, /sys, and /dev reflect its environment. Lookup remains within that mount namespace unless explicit authority grants access elsewhere.

/
├── home/user/
└── zones/
    ├── linux/root/
    │   ├── usr/
    │   ├── etc/
    │   ├── proc/
    │   ├── sys/
    │   └── dev/
    ├── freebsd/root/
    ├── windows/root/
    └── darwin/root/

Share selected files through bind or loopback mounts, directory capabilities, or an authorized file-selection service. LOFS and nullfs are useful references. A native directory such as /home/user/Documents can appear at the same path in a Linux zone and refer to the same underlying objects. Support read-only and writable shares, enforce mapped credentials and path traversal, and keep runtime and configuration directories private by default. A full shared home requires an explicit policy choice.

For example, a Linux application zone can use the Linux distribution under /zones/linux/root. Its policy grants writable mounts for the native Documents and Downloads directories at the same paths, authorizes selected native desktop sockets, and chooses a shared or separate network instance.

The Windows personality maps drive letters and NT paths into the namespace. The Darwin personality can expose /Users, /System, and /Applications. The VFS or personality owns this naming layer. A Linux application opening a shared document takes the foreign syscall path through its personality, then the native VFS and filesystem server. A physical block access goes through the native block service.

Application zones and system zones

Both configurations use the same zone mechanism. A brand supplies the default personality and environment. A native zone can use the facility independently of foreign ABI support.

A supported foreign executable launched from a native shell enters an application zone by default. The shell stays in its own zone and can wait for the child. Zone policy controls the child’s inherited descriptors and terminal access, visible files, and resource domain. An authorized launch may select a full system zone when the application needs its services. See Foreign executable and application ABIs for launch and runtime selection.

Resource

Application zone

System zone

Purpose

Individual foreign applications

Complete foreign userspace

Runtime and init

Minimal or distribution runtime, with only the services needed

Distribution or OS userspace with brand-specific init where supported

Local files

Explicit shares and user-approved file access

Private by default, with optional shares

Desktop

Shared native desktop through authorized services

Shared, nested, or dedicated desktop

Networking

Configurable shared or separate instance

Configurable, with isolation where required by policy

Cross-zone resource sharing

The zone manager authorizes shares. Native services enforce the bounds of each delegated handle or connection. Display access uses authorized X11 or Wayland sockets and descriptor transfer, audio and clipboard use authorized protocol endpoints, and GPU use delegates render handles and buffer objects. USB and other device access goes through explicit device services. Shared and isolated network modes both apply resource policy. Shared services also have their own trust model. X11, for example, can grant powerful cross-client access within a display session.

See Foreign executable and application ABIs for brand policy and dispatch, and Graphics and desktop for graphics buffer and desktop protocols.