2 Commits
Author SHA1 Message Date
Etienne PerotandgVisor bot 8d1cd3dbae seccomp: Refactor to allow arbitrary number of RuleSets.
This is meant to make #12557 possible to implement, i.e.
making it possible for the seccomp configuration to specify actions
other than deny/allow in the main `runsc` configuration. This change
doesn't do that but it adds the structures to make that possible.

PiperOrigin-RevId: 868246148
2026-02-10 11:41:43 -08:00
Etienne PerotandgVisor bot f784ea5b93 Add tooling to compile seccomp-bpf programs at bazel build time.
This adds a `precompiledseccomp` library which provides tooling to compile
`seccomp-bpf` programs and generate Go source code that contains the
resulting bytecode embedded into it. In turn, this bytecode can be used in
Go libraries.

This avoids spending time compiling and optimizing `seccomp-bpf` programs
at runsc container creation time.

This library also contains support for "variables", which are `uint32`s whose
values are part of the seccomp filters but only known at runtime. To support
this, the program is compiled twice with placeholder values for these
variables, and we verify that the offsets at which these values show up in the
bytecode is consistent across these two compilation attempts.

PiperOrigin-RevId: 583117683
2023-11-16 12:00:44 -08:00