Expand description
Builds and installs the classic-BPF seccomp filter.
Three tiers: syscalls answered by the supervisor (USER_NOTIF), syscalls
that need a ptrace stop to edit the tracee in place (TRACE), and
everything else (ALLOW). Namespace creation is refused with EPERM,
as a default container refuses it, because a tracee in a mount namespace
of its own cannot be served from the supervisor’s. The host’s 64-bit ABI
and its 32-bit compat ABI each get a number table; any other audit arch
(x32) is refused with ENOSYS. A compat table may be empty, which
refuses that ABI too.
The guest-stub restricted mode (see guest_stub) traps its trace list
into the guest’s SIGSYS handler instead, behind a prologue that lets
the stub’s own syscalls through by the gate they are made from.
Structs§
- Sock
Filter - Mirror of
struct sock_filter. - Sock
Fprog - Mirror of
struct sock_fprog. - Table
- One ABI’s share of the filter: its audit arch and its number lists.
Enums§
- Sub 🔒
- A table entry that needs to look at an argument before deciding.
Constants§
- BPF_JA 🔒
- BPF_
JEQ_ 🔒K - BPF_
JSET_ 🔒K - BPF_
LD_ 🔒W_ ABS - BPF_
RET_ 🔒K - SECCOMP_
RET_ 🔒TRAP SECCOMP_RET_TRAP: raiseSIGSYSin the calling thread instead.
Functions§
- arg_
offset 🔒 - Offset of the low 32 bits of
seccomp_data.args[i]. - build
- Builds the filter program.
- build_
tiers 🔒 - Builds the tiers shared by every mode.
- build_
trapped - Builds the filter of the guest-stub restricted mode.
- from_
bytes - Decodes a raw classic-BPF program as bubblewrap receives it on
--seccomp FD. - install
- Installs
programin the calling thread and returns the listener fd. - install_
plain - Installs a caller-supplied program without a listener (stacks on ours).
- jump 🔒
- stmt 🔒