WEP: core:process — Running Host Programs Without Extending Authority
Context
A Wado program has no way to run another program. A build script, a test that
calls git, a tool that wraps a compiler: each needs one, and each is stuck.
WASI has no process interface moving through its subgroup. Wado is the one to propose it, so this WEP designs the WIT as a WASI proposal from the start.
A child runs outside the Wasm sandbox
A Wasm guest reaches only what its host grants. A native child process reaches
whatever the user who started the host can reach. Without OS confinement,
granting spawn grants the user's whole authority. Deno documents its
--allow-run this way: allowing a subprocess is allowing everything, and the
permission system no longer holds. Node's --allow-child-process carries the
same warning.
A list of program names is not a boundary
Allowing git but not sh looks like a limit and is not one. A permitted
program turns into arbitrary code through its own arguments and environment:
git -c core.sshCommand=…,git --upload-pack=…,GIT_SSH_COMMANDLD_PRELOAD,DYLD_INSERT_LIBRARIES
Denylisting these is a race against every program's option parser. The boundary has to be the OS confining the child, or an explicit statement that the child is fully trusted. An allowlist can only record intent.
Decision
The rule: spawning never extends authority
A child is confined to the guest's own grants plus a fixed system baseline. A host that cannot confine a child does not offer process spawning at all.
This one rule carries the security model. It is the wado host's policy, not
the interface's contract: the WIT says only that a host confines a child as its
own policy says. Everything Wado would otherwise manage follows from it and is
left out:
- No program allowlist and no executable handle: the sandbox decides what may run.
- No denylist of environment keys: whatever the child runs, it stays inside the guest's grants.
- No process-specific permission per package. A dependency that spawns is in the
same authority class as one that writes files through
Preopens. Permissions per dependency are a question for effects in general, and belong to a WEP of their own.
The host sandbox is the last line of defense
#[ambient(E)] and a user-written #[cm("…")] redeclaration can
each reach Process without the effect showing in a signature. Wado does not
close these. The effect makes intent visible; it is not the security boundary.
The wado CLI will also run arbitrary Component Model .wasm, including
untrusted modules that no Wado compiler produced. For those the language is no
boundary at all, so the host sandbox must hold on its own. Development effort
goes to the sandbox.
A sandbox layer of Wado's own in wado-host
wado-host implements the sandbox itself rather than depending on a crate.
Three reasons:
- The policy language is small: subtrees with read-only, read-write or execute access, and the network all or none. A general-purpose crate's extra features are attack surface and audit scope Wado does not use.
- The parent stays unconfined and only the child is confined. A crate built for confining the current process is dangerous here.
- The candidates (nono, birdcage, wardstone and others) are young or dormant. Depending on one hands the speed of security fixes to someone else.
The policy is the subset both OS mechanisms express, so the two backends agree everywhere but the rows the table marks not restricted. On Linux it is roughly what Seatbelt provides on macOS:
| To restrict | macOS (Seatbelt) | Linux |
|---|---|---|
| Read and write, per subtree | file-read* / file-write* |
Landlock |
| Metadata, per subtree | file-read-metadata |
not restricted |
| Exec, including by a grandchild | process-exec |
Landlock EXECUTE |
| Network | network-outbound / network-inbound |
seccomp on socket |
| Signals and abstract sockets | isolated by default | Landlock scopes |
| UNIX sockets by path | network-outbound |
seccomp on socket |
| Leaving the process group | not restricted | seccomp |
| Typing into the terminal | file-ioctl |
seccomp on ioctl |
| Inherited, cannot be lifted | yes | yes |
On Linux, seccomp covers what Landlock does not:
- The network. Landlock restricts TCP only, so a UDP socket passes it. With the
network not granted, seccomp refuses
socketfor every family. - UNIX sockets named by a path. Landlock does not mediate
connectto one, so a child could reach D-Bus or another privileged service. seccomp refusessocketforAF_UNIXand leavessocketpair, which reaches nothing outside the child. setsidandsetpgid. The host ends a child by signalling its process group, so a descendant that left the group would outlive it.TIOCSTIandTIOCLINUX, which push input into a terminal. Underinherit_stdin, a child holds the user's terminal, and input it pushes there runs in the user's shell, outside any sandbox. Landlock's deviceioctlrule does not reach a descriptor the child inherited.ptrace.io_uring_setup. A ring performs its operations, opening a socket among them, without the system calls seccomp sees.
Starting a confined child
The parent wado runs wasmtime on several threads. Between fork and exec, a
multithreaded process may make only async-signal-safe calls: no allocation, no
lock. Each backend fits the confinement into that rule without re-executing
wado, so a host embedded in another binary spawns as wado does.
- Linux confines the child in
pre_exec. Landlock, seccomp andclose_rangeare bare system calls, so the window admits them. Everything they read is built before the fork: the ruleset, the BPF program, and anO_PATHdescriptor for each rule. - macOS starts the program through
/usr/bin/sandbox-execwithposix_spawn, which does not fork.sandbox_initcompiles the profile and allocates, so it runs insandbox-exec, a single-threaded process of its own, which then execs the program. Its manual page marks it deprecated, but macOS still ships it, much software depends on it, and nothing public does what it does.
Landlock takes each rule as a descriptor rather than a path. The rules for the guest's grants come from the descriptors of its preopens, which the host already holds, so no path is resolved a second time between the check and the use.
The macOS profile's text holds no path. A fixed base in the host's source is
followed by one rule per grant, (subpath (param "P0")), and each path reaches
it as a parameter, -D P0=/path. No path is spliced into SBPL, so no escaping
can rewrite the policy. Seatbelt matches the real path, so each parameter is
one: the path a grant's descriptor names (F_GETPATH), or the baseline path
canonicalized. A path is resolved through a link only where the link itself can
be read. So each link that resolving a grant's path reads shows its metadata and
nothing else: the links the path names, and the links those lead through. An
example is /Applications/Xcode.app on a machine with several Xcodes. The
profile allows file-ioctl only for what a program does with a terminal it
inherits: setting its mode and asking its line discipline and foreground group.
TIOCSTI stays refused, so no input reaches a terminal.
sandbox-exec reports a program it cannot start only on its own stderr, so
the host checks that the program exists before spawning it.
Descriptors
A child inherits descriptors 0, 1 and 2 and nothing else. Confinement mediates
what a child opens, never a descriptor it already holds, which keeps the access
it was opened with whatever the child's grants. Rust's standard library opens
every descriptor with O_CLOEXEC, but the descriptors wado itself inherited
from its parent carry no such flag.
- Linux calls
close_range(3, ~0, CLOSE_RANGE_CLOEXEC)inpre_exec, after the confinement. Marked rather than closed, the descriptor the standard library reports a failedexecthrough survives until theexec. - macOS sets
POSIX_SPAWN_CLOEXEC_DEFAULT, and the spawn's file actions place the child's stdio at 0, 1 and 2.POSIX_SPAWN_SETPGROUPgives the child its process group.
Escape tests
Writing the sandbox in-house obliges escape tests in CI on Linux and on macOS.
Each of these must fail: reading a file outside the grants, writing under a
read-only subtree, executing a binary outside the grants, executing one through
a grandchild, a TCP connection or a UDP datagram when the network is not
granted, connecting to a UNIX socket by path, a descendant surviving its group's
kill (on Linux), pushing input into an inherited terminal, escaping through a
symbolic link or .., and reading through a descriptor the host held open
across the spawn. On macOS, a grant whose path holds ", \ or ) must
confine to exactly that path.
Where it is offered
The host offers spawning only where the kernel can enforce the rule, and never in a weaker form:
- Linux: Landlock ABI 6 or later (kernel 6.12). ABI 6 adds the scopes that
isolate signals and abstract UNIX sockets. Without them a child could signal
or connect to processes outside its sandbox, which an untrusted module must
not do. The host reads the ABI number from
landlock_create_rulesetrather than the kernel version, which distributions backport against. - macOS: Seatbelt.
- Windows: WSL2 only. Under WSL2, the Linux build of
wadouses the Linux backend, so there is no Windows-specific code. The native Windows build does not offer spawning, and its trap message points to WSL2.
ABI 6 shuts out some current long-term-support kernels. Ubuntu 24.04's general availability kernel (6.8) does not qualify; its hardware enablement kernel does.
Two ways to leave it out
A world leaves the interface out by not importing it, as the Kiln generators'
world does. That is WASI's link-time capability model. The Component Model has
no optional import yet: a host that does not supply an import refuses to
instantiate the component, even one that would never spawn. So the wado host
links the interface wherever its world imports it, also under --deny-process
and on a kernel that falls short.
There, the interface answers at run time. get-availability returns
available, denied (the host turned it off) or unsupported (the OS cannot
confine a child), with no side effect. The two refusals call for different
remedies, a host flag for one and a newer OS for the other, so an option
getter in the style of wasi:cli's get-terminal-stdin, which merges them into
none, says too little.
Every other function of the interface requires get-availability to answer
available, and traps otherwise. The answer is fixed when the host starts, so
one query settles it for the instance's lifetime, and spawn's error-code
carries only failures of the one spawn. The WIT cannot state this as a contract,
so its documentation does.
System baseline
A native program reads paths a Wasm guest never needs: its loader, its shared libraries, its locale data. The baseline is that set, and it is the one way a child may read more than the guest. It is defined, not open-ended:
| Purpose | Linux | macOS |
|---|---|---|
| Loader and shared libraries | /lib* |
/usr/lib, /System, the dyld cache |
| Installed programs | /usr, /bin, /sbin, /nix/store |
/usr, /opt/homebrew, /opt/local, the developer tools |
| System configuration | /etc, name resolution and TLS certificates among it |
/private/etc, the shell /bin/sh runs |
| Name resolution and certificate trust (network only) | nothing beyond /etc |
mDNSResponder, trustd |
| Locale and time zones | /usr/share/zoneinfo, locale data |
the same |
| Devices | /dev/null, /dev/urandom, /dev/tty when inheriting |
the same, and /dev/fd with /dev/stdin, /dev/stdout and /dev/stderr |
| System and own process state | /proc/cpuinfo and the other system-wide entries, /proc/sys, the child's own /proc/<pid> |
nothing: macOS answers through sysctl |
| Scratch | a private HOME and TMPDIR per spawn, removed at exit |
the same |
- The baseline is read and execute only. The writable entries are the private
HOMEandTMPDIR,/dev/null, and/dev/ttywhen it is inherited. On macOS/dev/fdis writable too: opening/dev/fd/Ncopies descriptorN, which the child already holds, with no access it lacks. - On Linux
/dev/stdoutand the rest open again the file a stream is on, and Landlock judges that open on the file. So a file the child inherits a stream on is granted alone: read and execute for stdin, as the baseline is, and write alone for stdout and stderr, as the descriptor already is. - On macOS the developer tools are the Command Line Tools, which the
/usr/binstubs (git,cc,python3) run, and the plist that records that the Xcode license was accepted. A stub reads the linkxcode-selectkeeps, but not the directory it names. Xcode itself is not in the baseline:/Applicationsis writable by every admin user, root or not, so the entry could be swapped for a link to anywhere. A stub that finds no Xcode falls back to the Command Line Tools, and a user who wants Xcode grants its bundle, such as--process-read /Applications/Xcode.app. - Each entry sits in a directory only root can write, so no other user can
swap the entry for a link. What lies inside may be the user's, as under
/opt/homebrew. A link there leads only to its real path, which the sandbox judges on its own. - The list is fixed per OS in the host's source. Nothing in it is derived from
the program's path, which the guest chooses: deriving a prefix from
/home/u/bin/xwould open/home/u. A program outside these prefixes and outside the grants runs only from a path the user adds, such as~/.cargo. Such a path is read and execute only, and it is opened to every child and never to the guest. The user adds one in two places:--process-read <path>(run,serve,test). It is resolved through its symlinks whenwadostarts, so a path that names no file fails there.readunder[process]in the user config ($XDG_CONFIG_HOME/wado/config.toml, else~/.config/wado/config.toml), for a toolchain every run needs, such as~/.local/share/mise/installs. An entry is absolute or starts with~/, and is resolved at the first spawn. An entry that names no file on this machine warns and is skipped, so one file can serve several machines. The file is ignored whole, with a warning, when another user could have written it: it is owned by someone other than the user or root, or every user can write it. Group write is allowed, since under the user private groups most Linux distributions use, a file the user writes is664and the group holds the user alone.
- The real
HOMEis never in the baseline. A child sees it only through an explicit grant, so~/.sshstays out of reach by default. - No UNIX socket named by a path is open, except mDNSResponder's on macOS, where
name resolution goes through it. A socket such as D-Bus is a path to a
privileged service. On Linux, glibc resolves through
resolv.confwithout one. /etcis open whole. A toolchain reads its settings there (a JDK'sjava.securitylives in/etc/java-*), and what it holds is the system's, readable by every user. A secret under it, such as/etc/shadowor an SSH host key, is readable by root alone, which the guest's user is not.- On macOS a TLS client asks
trustdwhether to trust a certificate, throughcom.apple.trustd.agent(Security.framework, Go) orcom.apple.TrustEvaluationAgent(the systemcurl).trustdmay fetch what the certificate names, such as an intermediate or a revocation list, over the network on the child's behalf. - With the network not granted, mDNSResponder's socket and the trust services drop out.
Grants
- On by default wherever the sandbox works.
--deny-processturns it off. The sandbox keeps the child within the guest, so an opt-in would protect nothing. wado run,wado testandwado serveall offer it.- Kiln generators never do: a generator must be deterministic, and a child is free to read clocks and randomness.
- The child gets the guest's network grant, all or none. A child finer-grained than its guest would invert the rule.
- Each directory the guest is granted must map to the same path on the host;
otherwise
get-availabilityanswersdenied, and the trap a spawn raises names the mapping. A guest path that names another host path cannot appear in a child's arguments. The program still starts, since it may never spawn.wado run's default grant, the current directory as., counts as the same path: the child's working directory is that directory, so a relative path means the same thing on both sides. - Files inside a granted directory may be executed, so a binary the project just built can run. This adds no authority, since the child cannot leave the grants either way.
- A guest may give a child less than it holds.
Command::grant_readandCommand::grant_writename paths that replace the guest's directories; the baseline,--process-readand the child's privateHOMEstay. A guest that runs code it does not trust needs this: a code reviewer that builds a pull request in a checkout of its own must keep that build out of the repository and its.git, which the guest itself writes.- It is a builder method rather than an argument of
spawn, sincespawn,output,statusandreadall start a child, andcmd`…`returns aCommandto chain on. - Read and write are separate grants: a child that builds needs the tree writable and a toolchain readable.
- A path is relative to where the child starts, and must exist. The host
opens it once, checks the real path of that descriptor against what the
guest holds, and confines the child through the same descriptor, so a link
swapped in between reaches nothing. A path beyond the guest's access is
not-permitted.
- It is a builder method rather than an argument of
Diagnostics
The guest learns a failure as an error-code or an exit status. The host knows
more, and says it on its own stderr, with the fix where one exists:
- A trap from a host that offers no spawning names the reason and, for
--deny-processor a grant at another host path, the flag that changes it. - A program outside the grants and the baseline warns at its spawn with the
resolved path, and names the
--process-readgrant of the file refused and the user config entry that would let it run. So does a program whose#!interpreter or ELF loader lies outside them, whichexecopens too. A program that does not exist stays silent: a guest that probes for an optional tool expectsnot-found. - A child that fails, with a nonzero status or a signal, after the
filter refused it a call warns with the calls refused. The refusal may not be
why it failed, so the warning puts the two side by side and claims no cause.
Linux alone reports this: the filter refers each such call to the host
through a seccomp listener, and a host thread records it and answers
EPERM, so the child sees what a plainSECCOMP_RET_ERRNOwould give it. The child waits toexecuntil the host holds its listener, so a host out of descriptors fails the spawn rather than leave a call unanswered. The kernel allows one listener per chain of filters, so under an enclosing sandbox that holds one, the filter answersEPERMitself and nothing is reported. The host takes the listener on every spawn,--process-traceor not, so a child that installs its own (a container runtime's seccomp notify) fails withEBUSY. That was chosen over taking it only under the trace: a refusal leaves the child no clue that the sandbox caused its failure, so the report must come without a flag that only someone who already suspects the sandbox would pass. --process-trace(run,serve,test) also names each path the sandbox refused a child, with the grant that would allow it:--process-readfor a read,--dirfor a write, which the guest gains too. It reports whatever the child's end, since a child can carry on past a refusal and still go wrong. It needs the listener, so Linux alone offers it, and only on request, because each call that names a path then waits on the host. Where it cannot see, the first spawn under it warns why.
Each warning prints once per run however often the guest repeats the spawn.
Landlock answers a refused path with EACCES and leaves no record the host
can read; its audit log needs CAP_AUDIT_READ. So the trace watches the calls
rather than the refusals. The filter refers each call Landlock mediates (open,
execve, mkdir, unlink, rename, link, truncate and their at
forms) to the host with SECCOMP_USER_NOTIF_FLAG_CONTINUE. A host thread reads
the path from the child's memory and resolves it as the kernel does for the
child: against its working directory or the descriptor the call names, one
component at a time, with /proc/self naming the child. A link in a
process's /proc entry (cwd, fd/N) leads to an object rather than its
text, so its text counts only where it still names that object. The thread
leaves out a call that fails before Landlock's hook, as its flags and the
spelling of its path decide. A trailing / or . asks a lookup for a
directory and has it follow a link, and each call that removes or moves an
entry treats the / its own way. The thread checks the rest against the policy
where Landlock does: a call that makes, removes or moves an entry on the
directory holding it, an open on the file, an exec on the program and on each
interpreter it needs. The host reads an interpreter only where it is a regular
file, the one kind exec runs, so a FIFO the child names cannot hold the
host's thread. A call whose path the host may not read, under Yama's
ptrace_scope or from a non-dumpable process, is not reported as refused: a
warning says the trace missed calls, and why.
The kernel then runs the call, and Landlock judges it as it would have. Moving
enforcement itself to seccomp was rejected: the path a call names can change
after the host reads it, and no filter can emulate execve.
WIT
The interface ships as core:process@0.1.0, as core:eval and core:kiln
ship theirs, written in the shape a WASI proposal takes. Its WIT sits in
lib/core/process/, with the wasi:filesystem WIT it uses under deps/.
Claiming wasi: before the subgroup adopts it would promise compatibility Wado
cannot keep with other hosts. On adoption only the namespace changes.
The specification is the core:process module documentation, generated into
stdlib-core-process.md, with the WIT's own
comments for the interface. What follows is why it takes the shape it does.
- The WIT describes running a child, not confining one. Confinement is the
wadohost's policy, so the WIT names no sandbox, noPATH, no particular signal and no process group: another host may confine differently, or run on an OS that has none of them. Each such word lives in the module documentation's section on thewadohost. get-availabilitystays in the WIT. Not every WASI host should offer spawning, and a guest needs to learn which answer it got without trying.exit-statuscarries ans32in both cases. An earlier draft usedu8, Unix's exit range, on the grounds that Windows runs only under WSL2. That bound the interface to one OS family for no gain: a Windows exit code is 32 bits, and ans32holds every Unix status and signal number. WASI's ownexit-with-codetakes au8because it sets the guest's own status, which a Unix host truncates anyway; reporting a child's status has no such limit.error-codenames what a guest can act on: a missing program, one the host refuses, one that is no program, an argument or variable the host cannot pass (a NUL, or a name that is empty or holds=), arguments too long, a working directory that is not one, the host out of resources.othercarries a message for a person, as WASI's error variants do. A catch-alliosaid nothing a guest could branch on.cwdis its own parameter because a record cannot hold aborrow. Withnone, the child starts in the first preopened directory, the onecore:fsresolves paths against. The directory the host started in may lie outside the grants. A guest with no preopen gets the host's choice, andwadopicks the child's privateHOME.- There is no
find-executable: the host decides what runs, and a name it cannot find isnot-found. - The guest's environment is not passed on. The host's baseline variables come
first, and the guest's
envoverrides them. - The
wadohost signals a group only before it reaps the group's leader: the unreaped leader holds its pid, so the group's id cannot pass to an unrelated process. Once the child exits, the host kills what is left of its group before reaping it, so no descendant keeps the child's grants with nobody watching, and none holds a pipe the guest is reading open. - A child of an unconfined spawn shares its parent's process group, and with it
the parent's place on the terminal: it reads the terminal and sets its mode.
A group of its own reads and sets the terminal only as its foreground group,
so the
wadohost treats a child that inherits a stream from its terminal as a shell treats the job it runs:- Holding the terminal, the host hands it to the child's group before the
program starts, and takes it back once the child ends. Ctrl-C then reaches
the child alone, where a shared group would end the host too: the guest
sees the child end by
SIGINTand carries on. - One child holds the terminal at a time. Another starts in the background and writes there freely. If it reads the terminal or sets its mode, it waits until the first is done, then gets it.
- The host stops where a shared group would stop: when Ctrl-Z stops the child holding the terminal, and when a child uses the terminal while the host is in the background. Continued in the foreground, the host hands the terminal over again. The kernel discards a stop sent to an orphaned group, so a host whose group is orphaned does not stop: Ctrl-Z does nothing, as it would to a shared group.
- A child that stops, or that a signal ends, leaves the terminal in the host's mode, as a shell restores its own. A child that exits leaves the mode it chose. A host that exits while a child holds the terminal takes it back in its own mode first.
- Holding the terminal, the host hands it to the child's group before the
program starts, and takes it back once the child ends. Ctrl-C then reaches
the child alone, where a shared group would end the host too: the guest
sees the child end by
The timeout is the guest's
An earlier draft carried timeout: option<u64> in command, with a
timed-out exit status. At the deadline the host sent SIGTERM to the group,
then SIGKILL after a grace period the host set. It held while the guest was
blocked reading a stream, which was its reason to exist.
It was removed. A deadline is a policy, and the guest already has every piece
of it: exit is a future, wasi:clocks has a timer, and child has kill.
A host-side timeout fixed the policy's shape (one deadline, one grace, a host
option for the grace) and wrote SIGTERM into the interface.
Two pieces were missing, and were added instead:
child.terminateasks the child to end, wherekillends it. Without it a guest could only kill, so a child never got to clean up. A host with no way to ask does nothing, and a guest that needs the child gone follows withkill.- Wado could not wait on a
futurebeside a timer:Future::readblocked, and a bare end could not join aWaitableSet.Future::start_readnow starts the read and returns aFutureReadCopy, which a set waits on as it waits on a stream copy, andWaitableSet::drainhands back what a race left.
Child::wait_timeout and Child::stop build the policy from those, in
core:process rather than in every host. A guest blocked reading a pipe still
cannot watch the clock; it reads in a set beside the timer, as output reads
stdout and stderr together.
core:process
- One effect,
Process. Acontractclause cannot perform an effect, so the requirement thatavailabilityanswerAvailableis documented rather than written as a clause. inherit_*declareStdin,StdoutandStderr: a guest passes on only a capability it holds.outputreads stdout and stderr concurrently, so a child filling one pipe cannot deadlock against a parent reading the other.Childisaffine, and dropping it kills the process. There is nodetach: the host kills every child when the guest exits anyway.- A pipe nothing can reach would block the child, so none is left open.
waitcloses every stream still in theChild, andoutputandstatus, which hand out noChild, give the child no stream for one piped there. - Stdout past the capture limit is an
OutputTooLargeerror, since output with its middle cut out (JSON, say) is wrong rather than short. Stderr keeps its tail instead. The child is killed the moment stdout passes the cap: a child left writing into a pipe nobody reads would block forever. - Captured output is a
ByteList, never aString. A program's output is bytes, and decoding it is the caller's call, so no kind reports bad UTF-8. ProcessErrorwraps the host'sErrorCodein oneSpawnkind rather than mirroring each code, so a code the WIT gains reaches the guest unchanged. OnlyreadreturnsFailed:outputandstatushand the exit status back as a value, whilereadreturns only stdout and has nowhere else to report it.
The cmd template
cmd`…` builds an argument vector without a shell, so a hole never runs as
shell syntax and splits only as its type says: a List<String> hole is one
argument per element, and any other hole is one argument. Its rules are in the
cmd documentation. It can still be read as an option: a value starting with
- is one to the program, so a hole that may hold one goes after -- where
the program accepts it.
- A
List<String>hole joined to other text is refused rather than read one way: neither one argument nor one per element is the obvious reading. - Literal text must not hold a character a shell would treat specially, since
here it would mean nothing and the program would read it wrong. Writing
cmd`git commit -m "fix bug"`would otherwise pass"fixandbug"as two arguments. Starting strict leaves room to admit a character later; admitting one cannot be taken back.
Deliberate omissions
- A shell API.
sh -cis a program like any other, confined like any other. detach,find-executable, a program allowlist and an environment denylist, for the reasons above.
Roadmap
- [x] The sandbox layer in
wado-hostwith the Linux backend: the policy type, the baseline, Landlock and seccomp, the ABI 6 check, the confinement andclose_rangeinpre_exec. Done when the escape tests pass in CI on Linux. - [x] The macOS backend: the fixed profile, its parameters, and the
posix_spawnofsandbox-exec. Done when the escape tests pass in CI on macOS. - [x]
core:process@0.1.0in thewadohost:get-availability, spawning, streams,terminateandkill, killing the process group on drop and on guest exit,--deny-process, anddeniedfor a mapping that is not the same path. - [x]
core:processin the stdlib:Command,cmd,Child,output,statusandread,wait_timeoutandstop, with its stdlib reference and a cheatsheet entry. - [x]
Command::grant_readandCommand::grant_write, a child narrower than its guest. - [ ] Bounded resources. A child can run many children, use memory and CPU without bound, and fork without limit. Done when a child that tries any of these is stopped at a limit the host sets.
- [ ] A compile-time answer for a world that cannot spawn. A component that
spawns imports
core:process, which no WASI world defines, so only thewadohost instantiates it, and nothing at compile time says so: an effect the selected world does not import is imported all the same (Worlds). Done when compiling such a component reports it. - [ ] The remaining CLI surface: a flag that grants the real
HOME. Done when it is named and documented. - [ ]
core:processin the compiler's e2e harness. It does not link the interface, so a fixture cannot spawn; the stdlib's own tests cover it underwado test. Done when a fixture can spawn. - [ ] Spawning under a guest directory granted at a different host path, which turns spawning off. Done when the child sees the guest's view of it.
- [ ] Filtering the network per host through a proxy, for the guest and the child together.
Known gaps
-
No pseudo-terminal: a child that needs one (a full-screen editor) gets the inherited terminal or none.
-
A child waiting its turn for the terminal that the guest kills ends at once, but its exit reaches the guest only once the child holding the terminal is done: the host waits on the terminal for it then, not on the child.
-
A host whose group is orphaned in the background leaves a child that uses the terminal stopped, and the guest's wait does not return until the guest kills it. A child sharing the group would instead fail its read with
EIO. -
On macOS a child reads the arguments of every process its user runs, through
sysctl(KERN_PROCARGS2). Of each process not built as a platform binary it reads the whole environment too,wado's own among them, so a token in the environment that startedwadoreaches every child. Seatbelt mediates neither this call norproc_pidinfounder(deny default), and an explicitdenyofsysctl-readorprocess-info*still letsKERN_PROCARGS2through. On Linux, Landlock keeps a child out of every other process's/procentry. -
WSL2 is untested: GitHub's hosted Windows runners cannot run it, so the escape tests have never run there. A WSL2 kernel without Landlock ABI 6 fails safe: availability answers
unsupported, and nothing spawns. -
Landlock does not restrict
stat. A child on Linux can learn whether a path outside its grants exists, and its metadata. Seatbelt hides it but for the directories above a grant, which resolving a path stats, and the/varlink, which dyld stats. -
Seatbelt cannot stop a descendant from calling
setsid. On macOS such a descendant survives its group's kill and keeps the child's grants after the guest exits. -
Darwin's
killpganswersEPERMboth for a group holding only zombies and for a live member the guest's user cannot signal (a setuid program). The macOS backend readsEPERMas the first, so a group kill that missed such a member reports success. -
On macOS, a program the sandbox refuses to execute starts
sandbox-exec, which then exits with a status, rather than failing the spawn withnot-permitted. -
A confined child cannot confine a child of its own. Its
setpgidis refused, so awadothatcore:processstarted fails every spawn. The same refusal meets any descendant that callssetsidorsetpgiditself: a shell with job control, or a program that detaches into the background. A plainforkandexec, which is howgitruns its hooks and helpers, is not refused. -
A child cannot take a seccomp listener of its own: the kernel allows one per chain of filters, and the host holds it. A container runtime using seccomp notify, run as a child, fails with
EBUSY. -
Without
--process-trace, a file or directory the sandbox refused a child is not reported, so the child's own message is all there is. Under it, the host predicts the refusal from the policy rather than observing Landlock's. It resolves the path as the child does, and leaves out a call thatfs/namei.cfails before Landlock's hook. It does not model the file permissions, which may refuse the call first,openat2'sRESOLVE_*flags, or a rename between two mounts of one filesystem, which fails withEXDEV, so such a call may be reported though Landlock never judged it. -
Of the per-process entries of
/proc, a child reads only its own. A process it starts in turn cannot read its own/proc/self: Landlock rules name a path when the rule is made, and that process's pid does not exist yet. Another process's entry stays unreadable by design.
Related WEPs
core:fs— the preopens whose grants a child inherits.- External Subcommands — the
PATHruleprogramresolution reuses. - Kiln — the deterministic generators that never spawn.
- Concurrent Stream Copies —
how
outputandreadread stdout and stderr together. - Affine Types — the discipline
Childfollows.
