Skip to main content

Crate proot

Crate proot 

Source
Expand description

PRoot reimplemented in Rust.

The program runs a command inside a guest root filesystem without any privilege. Path-taking syscalls are routed through seccomp user notification and answered by a small pool of supervisor threads; only the syscalls that must change the tracee’s own state in place (execve, chdir, unix socket bind/connect) take a ptrace stop. Everything else runs untraced at native speed. Where ptrace is filtered out, those few syscalls are served through notifications too, with in-place rewrites (syscall::direct).

The binary behaves like bubblewrap when invoked through a name ending in bwrap, busybox style, so a symlink is enough to make it a drop-in.

ModulesΒ§

abi πŸ”’
Syscall ABIs a tracee may use.
access πŸ”’
How the supervisor gets the right to reach its tracees.
cli πŸ”’
PRoot command-line front end (the subset proot-apps and users rely on).
config πŸ”’
Runtime configuration shared by both command-line front ends.
exec πŸ”’
execve handling at the ptrace stop.
fs πŸ”’
Guest filesystem view: the root, the bindings, and path translation.
guest_stub πŸ”’
The supervisor’s side of the guest-stub restricted mode.
launch πŸ”’
Starting the first tracee and wiring supervisor, listener and tracer.
procs πŸ”’
Per-process bookkeeping shared by every handler: the program a process runs, the identity it believes it has under -0 and, without ptrace, the working directory it believes it is in.
seccomp πŸ”’
Seccomp: the BPF filter the tracee installs, and the listener pool that answers user notifications.
state πŸ”’
Supervisor-wide shared state.
sys πŸ”’
Raw kernel ABI not covered (or not covered stably) by the libc crate: the seccomp user-notification structures and ioctls, plus small helpers.
syscall πŸ”’
Syscall routing: which numbers go where, and the handlers for each tier.
tracee πŸ”’
Access to a tracee: its memory and, at ptrace stops, its registers.
tracer πŸ”’
The ptrace event loop. Runs on the thread that forked the first tracee.

MacrosΒ§

note
Logs to stderr when verbose is at least level.

FunctionsΒ§

main πŸ”’
Program entry point.