runsc/boot/filter/config: Import platforms from platforms package.

This unifies the conditional compilation rules of the platforms that
are precompiled into `runsc` and its seccomp filters, rather than
needlessly maintaining it into two places.

This also fixes debug-mode compilation. Debug builds currently can't
include the KVM platform due to its use of `nosplit` in stacks that
become too big in debug builds. This was previously worked around by
excluding KVM from the list of platforms built for debug builds in
`//pkg/sentry/platform/platform`, but this build dependency was
re-introduced in `//runsc/boot/filter/config`. This change fixes this.

PiperOrigin-RevId: 590735685
This commit is contained in:
Etienne Perot
2023-12-13 15:44:34 -08:00
committed by gVisor bot
parent 8c0554d9ea
commit d777746776
2 changed files with 3 additions and 7 deletions
+1 -2
View File
@@ -34,10 +34,9 @@ go_library(
"//pkg/sentry/devices/nvproxy",
"//pkg/sentry/devices/tpuproxy",
"//pkg/sentry/platform",
"//pkg/sentry/platform/kvm",
"//pkg/sentry/platform/systrap",
"//pkg/sentry/socket/hostinet",
"//pkg/tcpip/link/fdbased",
"//runsc/boot/platforms",
"@org_golang_x_sync//errgroup:go_default_library",
"@org_golang_x_sys//unix:go_default_library",
],
@@ -23,11 +23,8 @@ import (
"gvisor.dev/gvisor/pkg/seccomp/precompiledseccomp"
"gvisor.dev/gvisor/pkg/sentry/platform"
// Compile filters for KVM.
_ "gvisor.dev/gvisor/pkg/sentry/platform/kvm"
// Compile filters for Systrap.
_ "gvisor.dev/gvisor/pkg/sentry/platform/systrap"
// Import platforms that we need to precompile filters for.
_ "gvisor.dev/gvisor/runsc/boot/platforms"
)
// Variable names used in precompiled filters.