mirror of
https://github.com/hanzoai/visor.git
synced 2026-09-24 17:04:14 +00:00
This removes the interface indirection from BPF evaluation, which is
a very hot path (runs for every application syscall for seccomp'd containers)
and simplifies the code in general.
```
│ initial │ hey_look_no_interfaces │
│ sec/op │ sec/op vs base │
Interpreter 26.31n ± 0% 21.12n ± 0% -19.73% (p=0.000 n=21+20)
```
PiperOrigin-RevId: 576375947
41 lines
965 B
Python
41 lines
965 B
Python
load("//tools:defs.bzl", "go_library", "go_test")
|
|
|
|
package(
|
|
default_applicable_licenses = ["//:license"],
|
|
licenses = ["notice"],
|
|
)
|
|
|
|
go_library(
|
|
name = "seccomp",
|
|
srcs = [
|
|
"audit_amd64.go",
|
|
"audit_arm64.go",
|
|
"seccomp.go",
|
|
],
|
|
visibility = ["//:sandbox"],
|
|
deps = [
|
|
"//pkg/abi/linux",
|
|
"//pkg/bpf",
|
|
"//pkg/log",
|
|
"//pkg/seccomp",
|
|
"//pkg/sentry/kernel",
|
|
"//pkg/sentry/syscalls/linux",
|
|
"@com_github_opencontainers_runtime_spec//specs-go:go_default_library",
|
|
"@org_golang_x_sys//unix:go_default_library",
|
|
],
|
|
)
|
|
|
|
go_test(
|
|
name = "seccomp_test",
|
|
size = "small",
|
|
srcs = ["seccomp_test.go"],
|
|
library = ":seccomp",
|
|
deps = [
|
|
"//pkg/abi/linux",
|
|
"//pkg/bpf",
|
|
"//pkg/seccomp",
|
|
"@com_github_opencontainers_runtime_spec//specs-go:go_default_library",
|
|
"@org_golang_x_sys//unix:go_default_library",
|
|
],
|
|
)
|