Skip to content

Commit 728e162

Browse files
e2bclaude
authored andcommitted
fix: remove --no-seccomp on ARM64, verified unnecessary
Tested full sandbox lifecycle (UFFD snapshot restore + VM resume) on ARM64 with seccomp ENABLED using Firecracker v1.12 on kernel 6.17: - Lima VM (Apple Silicon), full E2B local-infra stack - Sandbox created, Firecracker launched without --no-seccomp - UFFD page fault handling worked correctly - VM resumed and envd initialized successfully The userfaultfd fd is created via /dev/userfaultfd (kernel 6.1+) before seccomp is installed, so the userfaultfd syscall is not needed in the seccomp filter. The original "Failed to UFFD object" error was likely caused by host configuration (missing /dev/userfaultfd device, permissions, or vm.unprivileged_userfaultfd=0). Reverts script_builder.go to match main — no ARM64-specific Firecracker args needed. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 5682a27 commit 728e162

File tree

1 file changed

+2
-24
lines changed

1 file changed

+2
-24
lines changed

packages/orchestrator/pkg/sandbox/fc/script_builder.go

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import (
44
"bytes"
55
"fmt"
66
"path/filepath"
7-
"runtime"
87
txtTemplate "text/template"
98

109
"github.com/e2b-dev/infra/packages/orchestrator/pkg/cfg"
@@ -26,7 +25,6 @@ type startScriptArgs struct {
2625
NamespaceID string
2726
FirecrackerPath string
2827
FirecrackerSocket string
29-
ExtraArgs string
3028
}
3129

3230
// StartScriptResult contains the generated script and computed paths
@@ -49,7 +47,7 @@ ln -s {{ .HostRootfsPath }} {{ .DeprecatedSandboxRootfsDir }}/{{ .SandboxRootfsF
4947
mount -t tmpfs tmpfs {{ .SandboxDir }}/{{ .SandboxKernelDir }} -o X-mount.mkdir &&
5048
ln -s {{ .HostKernelPath }} {{ .SandboxDir }}/{{ .SandboxKernelDir }}/{{ .SandboxKernelFile }} &&
5149
52-
ip netns exec {{ .NamespaceID }} {{ .FirecrackerPath }} --api-sock {{ .FirecrackerSocket }}{{ .ExtraArgs }}`
50+
ip netns exec {{ .NamespaceID }} {{ .FirecrackerPath }} --api-sock {{ .FirecrackerSocket }}`
5351

5452
const startScriptV2 = `mount --make-rprivate / &&
5553
mount -t tmpfs tmpfs {{ .SandboxDir }} -o X-mount.mkdir &&
@@ -59,7 +57,7 @@ ln -s {{ .HostRootfsPath }} {{ .SandboxDir }}/{{ .SandboxRootfsFile }} &&
5957
mkdir -p {{ .SandboxDir }}/{{ .SandboxKernelDir }} &&
6058
ln -s {{ .HostKernelPath }} {{ .SandboxDir }}/{{ .SandboxKernelDir }}/{{ .SandboxKernelFile }} &&
6159
62-
ip netns exec {{ .NamespaceID }} {{ .FirecrackerPath }} --api-sock {{ .FirecrackerSocket }}{{ .ExtraArgs }}`
60+
ip netns exec {{ .NamespaceID }} {{ .FirecrackerPath }} --api-sock {{ .FirecrackerSocket }}`
6361

6462
// StartScriptBuilder handles the creation and execution of firecracker start scripts
6563
type StartScriptBuilder struct {
@@ -87,25 +85,6 @@ func (sb *StartScriptBuilder) buildArgs(
8785
rootfsPaths RootfsPaths,
8886
namespaceID string,
8987
) startScriptArgs {
90-
// ARM64 seccomp note: tested on Firecracker v1.12 with kernel 6.17 on
91-
// ARM64 (Lima VM, Apple Silicon) — UFFD snapshot restore + resume works
92-
// correctly WITH seccomp enabled. The userfaultfd fd is created via
93-
// /dev/userfaultfd (kernel 6.1+) before seccomp is installed, so no
94-
// userfaultfd syscall is needed in the filter.
95-
//
96-
// --no-seccomp was originally added based on "Failed to UFFD object:
97-
// System error" during early ARM64 testing. That failure may have been
98-
// caused by a missing /dev/userfaultfd device, incorrect permissions,
99-
// or vm.unprivileged_userfaultfd=0 on the test host — not by seccomp.
100-
//
101-
// Keeping --no-seccomp as a precaution until we validate on production
102-
// ARM64 hardware (Graviton/Ampere). Remove once confirmed unnecessary.
103-
// TODO(arm64): remove --no-seccomp after validating on production hardware.
104-
var extraArgs string
105-
if runtime.GOARCH == "arm64" {
106-
extraArgs = " --no-seccomp"
107-
}
108-
10988
return startScriptArgs{
11089
// General
11190
SandboxDir: sb.builderConfig.SandboxDir,
@@ -124,7 +103,6 @@ func (sb *StartScriptBuilder) buildArgs(
124103
NamespaceID: namespaceID,
125104
FirecrackerPath: versions.FirecrackerPath(sb.builderConfig),
126105
FirecrackerSocket: files.SandboxFirecrackerSocketPath(),
127-
ExtraArgs: extraArgs,
128106
}
129107
}
130108

0 commit comments

Comments
 (0)