15:30
-
15:55
-
15:55
Day 2
Syd: Writing an application kernel in Rust
<p><a href="https://gitlab.exherbo.org/sydbox/sydbox/">Syd</a> (sydbox-3) is an application kernel written in Rust. This talk is a tour of its runtime architecture and the Rust that makes it portable. We’ll walk through the threads and their roles: <code>syd_main</code> (startup, namespaces, policy load, lock), <code>syd_mon</code> (lifecycle, seccomp-notify plumbing), a CPU-sized pool of <code>syd_emu</code> workers (syscall brokering), <code>syd_ipc</code> (UNIX-socket control when <a href="https://man.exherbo.org/syd.2.html#ipc"><code>lock:ipc</code></a> is enabled), <code>syd_int</code> (timers/alarms), and <code>syd_aes</code> (<strong>AF_ALG</strong> crypto for <a href="https://man.exherbo.org/syd.7.html#Crypt_Sandboxing">Crypt sandboxing</a>, plus helpers <code>syd-pty</code> and <code>syd-tor</code>. Implementation highlights: minimal unsafe at the syscall edge; per-thread isolation with <code>unshare(CLONE_FS|CLONE_FILES)</code> and per-thread <em>seccomp</em>(2); <a href="https://man.exherbo.org/syd.7.html#Syscall_Argument_Cookies">syscall-argument cookies</a>; forced <strong>O_CLOEXEC</strong> and <a href="https://man.exherbo.org/syd.7.html#Force_Randomized_File_Descriptors">randomized FDs</a>; deterministic "last-match-wins" policy; and <em>mseal</em>(2) sealing on <code>lock:on</code>. Portability is first-class: one codebase for Linux ≥ 5.19 with proper multi-arch support (x86-64/x86/x32, arm64/armv7, ppc64{b,l}e, riscv64, s390x, loongarch64), ILP32/LP64 awareness, and MSRV 1.83+. You’ll leave with concrete patterns for building a thread-isolated, multi-arch syscall broker in Rust.</p>