From 1f34ccc00973f6209bff3540cb02829557e1708d Mon Sep 17 00:00:00 2001 From: dawn Date: Fri, 19 Jun 2026 19:03:19 +0000 Subject: [PATCH] spindle/microvm: dont enable sandboxing in slirp4netns slirp4netns has a bug where it will break host devices on root user if this is enabled. so to avoid this, let's disable it. the sandboxing doesn't matter here because slirp4netns runs next to spindle anyway so if slirp is compromised you have bigger issues, and seccomp is still enabled, and if you really care your spindle should be a hardened systemd service anyway. Signed-off-by: dawn --- spindle/engines/microvm/networking.go | 35 ++++++++++++++++++++--------------- 1 file(s) changed, 20 insertion(s)(+), 15 deletion(s)(-) diff --git a/spindle/engines/microvm/networking.go b/spindle/engines/microvm/networking.go --- a/spindle/engines/microvm/networking.go +++ b/spindle/engines/microvm/networking.go @@ -122,21 +122,7 @@ return nil, nil, fmt.Errorf("slirp4netns command not found in PATH: %w", err) } - args := []string{ - "--configure", - "--mtu=" + netnsMTU, - } - if !n.dev { - args = append(args, "--disable-host-loopback") - } - args = append(args, - "--enable-sandbox", - "--enable-seccomp", - "--exit-fd=3", - "--cidr="+outerSlirpCIDR, - pid, - netnsTapName, - ) + args := slirpArgs(n.dev, pid) cmd := exec.CommandContext(ctx, slirpPath, args...) cmd.ExtraFiles = []*os.File{exitR} @@ -149,4 +135,23 @@ ok = true return cmd, exitW, nil +} + +func slirpArgs(dev bool, pid string) []string { + args := []string{ + "--configure", + "--mtu=" + netnsMTU, + } + if !dev { + args = append(args, "--disable-host-loopback") + } + args = append(args, + "--disable-dns", + "--enable-seccomp", + "--exit-fd=3", + "--cidr="+outerSlirpCIDR, + pid, + netnsTapName, + ) + return args } -- tangled.sh