Repository navigation
Conversation
Sandboxing
Launch VM and TPM Mesh hosts in Linux user and mount namespaces, adding a network namespace for restricted profiles. Retain PAL's vfork path by self-mapping the effective UID/GID before exec, then apply role-owned policy before tracing and Mesh startup. Known gaps: VM and TPM profiles remain broad and identical; inherited-handle grants are not wired or enforced; VNC/GDB and non-Linux sandbox backends are not covered; and full VM/TPM boot validation remains outstanding.
Integrate sandbox spawn
Removed references do uncommitted docs.
Removed description, should apply to all workers
Removed un-grounded non-goals
Add in-process Linux worker syscall tracing and a sandbox_profile_builder tool that converts worker JSONL traces into candidate sandbox profiles.
Trace only sandbox-profile-relevant syscalls so KVM hot paths run without ptrace stops while preserving syscall results and decoded arguments.
- load platform syscall denials from JSON configuration - derive filesystem, network, and syscall policies from worker traces - document the sandbox profiling workflow
- move worker syscall tracing into a separate pal_tracer crate - derive filesystem, network, and syscall sandbox policies from worker traces - replace separate syscall-denial rationale documentation with reasons stored alongside each denial in structured JSON - wire PAL tracing into OpenVMM worker process launch
Generate sandbox profiles automatically from worker traces
Documentation cleanup
Replace the JSON denylist and runtime parsing with static mandatory and optional syscall inventories. Update tracing, profiling, and the sandbox test launcher to consume the shared sandbox policy.
There was a problem hiding this comment.
🔵 Needs a closer look
Unresolved signal-isolation gaps let workers kill same-UID host processes, while filesystem restrictions break configured virtio-fs shares and traced-launch defects can hang worker startup.
14 open issues
[P1] These flags leave the worker in the host IPC namespace. Since the UID mapping preserves the… [P1] Compile the tracing BPF program before cloning: tracing disables vfork, so converting… [P1] Applying this fixed profile breaks virtio-fs shares outside its grants, such as… Restrict worker signals across PID and UID boundaries Enforce clone restrictions and deny vfork Restrict worker signals to prevent controller termination [P2] Tracing only these *at variants misses nativemkdir,unlink, andrenamecalls used for… [P2] Forward genuine SIGTRAP signals to the tracee. Seccomp stops, syscall stops, and nonzero… Map requested identities into the user namespace Merge filesystem grants before mounting ancestors Use unique atomic staging directories for sandboxes Allow required implicit proc accesses under Landlock Clean up stopped workers on tracing startup failures Scan args_os to support non-UTF-8 paths
1 resolved since last review
Review effort: Balanced
Mount ancestors before descendants and union compatible permissions across duplicate and nested grants so builder order cannot hide earlier access. Reject overlapping write and execute permissions before filesystem setup. Extend existing runtime tests to exercise both declaration orders, nested permissions, and device grant composition. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 252beba7-825f-475b-9a31-8da82494a58b
Compose filesystem grants before mounting
There was a problem hiding this comment.
🔵 Needs a closer look
Missing IPC isolation lets compromised workers access the controller user’s host IPC objects, while post-clone allocation can deadlock traced-worker startup.
12 open issues
[P1] These flags leave the worker in the host IPC namespace. Since the UID mapping preserves the… [P1] Compile the tracing BPF program before cloning: tracing disables vfork, so converting… [P1] Applying this fixed profile breaks virtio-fs shares outside its grants, such as… Restrict worker signals across PID and UID boundaries Restrict worker signals to prevent controller termination [P2] Tracing only these *at variants misses nativemkdir,unlink, andrenamecalls used for… [P2] Forward genuine SIGTRAP signals to the tracee. Seccomp stops, syscall stops, and nonzero… Map requested identities into the user namespace Use unique atomic staging directories for sandboxes Allow required implicit proc accesses under Landlock Clean up stopped workers on tracing startup failures Scan args_os to support non-UTF-8 paths
2 resolved since last review
Review effort: Balanced
Scan args_os and match the ASCII role option without requiring unrelated paths to be UTF-8. Keep unknown and duplicate roles as errors, including malformed non-UTF-8 role values, and cover these cases with parser regressions. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 252beba7-825f-475b-9a31-8da82494a58b
Handle non-UTF-8 paths during sandbox role scanning
There was a problem hiding this comment.
🔵 Needs a closer look
Unresolved defects allow workers to signal the controller or sibling workers and can deadlock worker startup through unsafe allocator use after raw clone.
11 open issues
[P1] These flags leave the worker in the host IPC namespace. Since the UID mapping preserves the… [P1] Compile the tracing BPF program before cloning: tracing disables vfork, so converting… [P1] Applying this fixed profile breaks virtio-fs shares outside its grants, such as… Restrict worker signals across PID and UID boundaries Restrict worker signals to prevent controller termination [P2] Tracing only these *at variants misses nativemkdir,unlink, andrenamecalls used for… [P2] Forward genuine SIGTRAP signals to the tracee. Seccomp stops, syscall stops, and nonzero… Map requested identities into the user namespace Use unique atomic staging directories for sandboxes Allow required implicit proc accesses under Landlock Clean up stopped workers on tracing startup failures
1 resolved since last review
Review effort: Balanced
Grant file-specific access for proc maps, worker naming, and the overcommit setting without exposing unrelated proc files. Add an isolated regression that verifies real reads and writes with Landlock enforced. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 252beba7-825f-475b-9a31-8da82494a58b
Allow required implicit proc accesses under Landlock
There was a problem hiding this comment.
🔵 Needs a closer look
Workers retain unrestricted same-UID signaling authority in the host PID namespace, allowing a compromised worker to terminate the controller or sibling workers despite sandboxing.
10 open issues
[P1] These flags leave the worker in the host IPC namespace. Since the UID mapping preserves the… [P1] Compile the tracing BPF program before cloning: tracing disables vfork, so converting… [P1] Applying this fixed profile breaks virtio-fs shares outside its grants, such as… Restrict worker signals across PID and UID boundaries Restrict worker signals to prevent controller termination [P2] Tracing only these *at variants misses nativemkdir,unlink, andrenamecalls used for… [P2] Forward genuine SIGTRAP signals to the tracee. Seccomp stops, syscall stops, and nonzero… Map requested identities into the user namespace Use unique atomic staging directories for sandboxes Clean up stopped workers on tracing startup failures
1 resolved since last review
Review effort: Balanced
Reserve Identity UID/GID values for future host identity provisioning and reject explicit requests during preparation. Remove sandbox credential-setting launch fields and reject PAL identity overrides with user namespace self-mapping, while preserving ordinary process identity changes. Document controller identity inheritance and remove stale claims of per-worker host identity isolation and worker-side UID/GID switching. Cover rejected zero and nonzero requests, default namespace mappings, and ordinary PAL launches. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 252beba7-825f-475b-9a31-8da82494a58b
…tities Defer unsupported sandbox host identities explicitly
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved sandbox isolation flaws let compromised workers terminate the controller through same-UID signaling and, when run as root, read sensitive host files such as /etc/shadow.
13 open issues
Prevent root workers from reading host secrets · New Restrict worker signals to other host processes · New [P1] These flags leave the worker in the host IPC namespace. Since the UID mapping preserves the… [P1] Compile the tracing BPF program before cloning: tracing disables vfork, so converting… [P1] Applying this fixed profile breaks virtio-fs shares outside its grants, such as… Restrict worker signals across PID and UID boundaries Restrict worker signals to prevent controller termination Clear FD_CLOEXEC for explicitly inherited descriptors · New Preserve virtio-fs share access after sandboxing · New [P2] Tracing only these *at variants misses nativemkdir,unlink, andrenamecalls used for… [P2] Forward genuine SIGTRAP signals to the tracee. Seccomp stops, syscall stops, and nonzero… Use unique atomic staging directories for sandboxes Clean up stopped workers on tracing startup failures
1 resolved since last review
Review effort: Balanced
| DeniedSyscall { | ||
| name: "waitid", | ||
| enforcement: MANDATORY, | ||
| reason: None, | ||
| }, |
Replace recursive /etc grants with optional loader, resolver/NSS, and OpenSSL configuration files. Narrow the TPM SSL directory grant as well to prevent aliases from re-exposing private keys, and bind resolver configuration directly without granting its runtime target. Exercise file access, missing configuration, resolver symlinks, NSS lookup, and denial of private fixtures in isolated namespace tests. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 252beba7-825f-475b-9a31-8da82494a58b
Request CLONE_NEWIPC for every confined Linux launch, including unrestricted-network profiles. Keep namespace creation required with no weaker fallback. Exercise SysV shared memory, semaphore, and message queue isolation through real PAL launches for both worker roles and both clone modes. Update namespace documentation and kernel creation-order guidance. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 252beba7-825f-475b-9a31-8da82494a58b
Allocate owner-only staging mountpoints with mkdtemp instead of reusing a fixed host pathname. Remove the backing directory through the old root after pivot_root, and detach all staging mount layers before nonrecursive cleanup on setup errors. Cover pre-existing files and symlinks, unique private allocations, successful cleanup, mount and grant failures, and stacked root-grant mounts without deleting writable bind contents. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 252beba7-825f-475b-9a31-8da82494a58b
Compile tracing bytecode in the parent so the pre-exec callback only borrows and installs it, without compiling or dropping heap-owned filter state. Return compilation errors from spawn before creating a child instead of silently skipping the tracing filter. Document the parent-side compilation contract and add an oversized-filter regression. Existing live tracing tests continue to verify successful filter installation. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 252beba7-825f-475b-9a31-8da82494a58b
Continue consuming synthetic ptrace and syscall stops, but forward genuine SIGTRAP signals so application handlers and default termination behave normally. Preserve existing SIGSTOP handling. Add traced child regressions for a SIGTRAP handler and an unhandled SIGTRAP, with core dumps disabled for the latter. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 252beba7-825f-475b-9a31-8da82494a58b
Sandbox/pr 4755 narrow etc
There was a problem hiding this comment.
🟡 Changes recommended
Workers can kill the controller through permitted same-UID signaling, and tracer startup failures can leave stopped child processes unreaped.
11 open issues
Landlock failure warnings are lost before tracing initializes · New Workers can signal and terminate the controller · New Restrict worker signals to other host processes [P1] Applying this fixed profile breaks virtio-fs shares outside its grants, such as… Restrict worker signals across PID and UID boundaries Restrict worker signals to prevent controller termination RPC worker tracing ignores the configured trace directory · New Filesystem isolation breaks hybrid-vsock endpoint access · New Unshare test fails when user namespaces are disabled · New [P2] Tracing only these *at variants misses nativemkdir,unlink, andrenamecalls used for… Clean up stopped workers on tracing startup failures
7 resolved since last review
Prevent root workers from reading host secrets [P1] These flags leave the worker in the host IPC namespace. Since the UID mapping preserves the… [P1] Compile the tracing BPF program before cloning: tracing disables vfork, so converting… Preserve virtio-fs share access after sandboxing Clear FD_CLOEXEC for explicitly inherited descriptors [P2] Forward genuine SIGTRAP signals to the tracee. Seccomp stops, syscall stops, and nonzero… Use unique atomic staging directories for sandboxes
Review effort: Balanced
| } | ||
|
|
||
| fn do_main(pidfile_guard: &mut Option<pidfile::Pidfile>) -> anyhow::Result<i32> { | ||
| meshworker::apply_vmm_mesh_host_sandbox()?; |
|
|
||
| #[cfg(target_os = "linux")] | ||
| fn linux_clone_flags(profile: &Profile) -> u64 { | ||
| let mut flags = libc::CLONE_NEWUSER | libc::CLONE_NEWNS | libc::CLONE_NEWIPC; |
| #[cfg(target_os = "linux")] | ||
| None, |
| let profile = Profile::deny_all() | ||
| .name("vm_worker") | ||
| .read("/sys/devices") | ||
| .read_exec("/usr/lib") |
| #[test] | ||
| fn network_operations_work_in_namespace() { | ||
| let exe = std::env::current_exe().expect("failed to get test executable path"); | ||
| let output = Command::new("unshare") | ||
| .args(["--user", "--map-root-user", "--net"]) |


This PR includes several features to enable sandboxing of OpenVMM worker processes on linux hosts.
The profiling features uses ptrace to capture and log syscalls.
The sandboxing crate uses process namespaces created upon process fork, along with landlock and seccomp profiles applied shortly after process spawn.
This change also modifies ttrpc invocations to spawn worker processes instead of using inproc mesh.