feat(worker): V1-2.3 sandboxed verify child and sheet-verify job mode

This commit is contained in:
bchanot committed 2026-11-01 17:20:07 +01:00
1 parent 345dde59e6
commit 31fbb0317f
24 files changed
+2145 -87

No files matched your search

+12 -7
View File
@@ -1,7 +1,8 @@
//! Confinement of the decode child (review Part IV.1), applied by the child itself from a
//! single-threaded process before it reads any input. Three layers: an empty environment
//! (cleared by the parent, checked in `decode`), rlimits on address space and CPU time, and
//! a seccomp allowlist installed with TSYNC that kills the process on any other syscall.
//! Confinement of the decode and verify children (review Part IV.1), applied by the child
//! itself from a single-threaded process before it reads any input. Three layers: an empty
//! environment (cleared by the parent, checked in `decode` and `verify`), rlimits on address
//! space and CPU time, and a seccomp allowlist installed with TSYNC that kills the process on
//! any other syscall.
use std::collections::BTreeMap;
use std::fmt;
@@ -13,16 +14,20 @@ use seccompiler::{
use crate::limits;
/// Syscalls the decode child makes once the filter is installed (static musl binary, x86_64).
/// Syscalls the decode and verify children make once the filter is installed (static musl
/// binary, x86_64).
///
/// Derived with `strace -f` over the fixture corpus at the caps (`crates/worker/scripts/
/// derive-seccomp.sh`, run by the Dockerfile stage `test`, 2026-10-12: exactly these seven
/// after the marker) and proven by running every fixture through the full sandbox. musl's
/// mallocng used neither `brk` nor `mprotect`, and no `futex` appears in a single-threaded
/// decode.
/// mallocng used neither `brk` nor `mprotect` there, and no `futex` appears in a
/// single-threaded child. The verify child at the caps (2026-11-01) adds `brk`: mallocng
/// grows its heap for the core's many small allocations; it only moves the program break,
/// bounded by `RLIMIT_AS`.
pub const ALLOWED_SYSCALLS: &[(&str, i64)] = &[
("read", libc::SYS_read),
("write", libc::SYS_write),
("brk", libc::SYS_brk),
("mmap", libc::SYS_mmap),
("munmap", libc::SYS_munmap),
("mremap", libc::SYS_mremap),