Deep Review: 20261006-184956-pr-5581
| Date | 2026-10-06 18:49 |
| Repo | lima-vm/lima |
| Round | 1 |
| Author | @ranacseruet |
| PR | #5581 — vz: add hostLoopback option to block guest access to host loopback |
| Branch | feat/host-loopback-opt-out |
| Commits | 67a1e1be vz: add hostLoopback option to block guest access to host loopbackfc7b27dc hostLoopback: reject on wsl2 and hcs, warn about loopback proxiese1cbcd18 cidata: use an early continue in the proxy loopback rewrite |
| Review SHA | e1cbcd18586a26fdbac49f5933473f15a645f18a |
| Reviewers | Claude Opus 5.5 (effort: high), Codex GPT 6 Astra (effort: high), Gemini 3.1 Pro (effort: default), Gemini 3.5 Flash (effort: default) |
| Verdict | Merge with fixes — the approach is sound, but blocked connections hang instead of being refused, UDP to 0.0.0.0 still reaches host loopback, and the driver refusals block limactl delete |
| Wall-clock time | 56 min 0 s |
Executive Summary ¶
The PR adds hostLoopback: false for vz, which drops the gateway's 192.168.5.2 → 127.0.0.1 NAT entry. But the host then dials 192.168.5.2 on its own network, so guest connections to host.lima.internal hang (75 s here) instead of being refused, and ten pending ones stall all new guest TCP. A root guest still reaches host loopback over UDP through 0.0.0.0, and the new driver refusals block limactl delete. Each problem has a small fix.
Critical Issues ¶
None.
Important Issues ¶
hostLoopback: false, connections to host.lima.internal hang or reach the LAN instead of being refused Claude Opus 5.5¶
// natTable returns the gateway's NAT table. By default the gateway IP maps to the host's loopback,
// so that the guest can reach host services (including ones bound to 127.0.0.1) as `host.lima.internal`.
// The gateway still answers DNS itself without this entry.
func natTable(gatewayIP string, disableHostLoopback bool) map[string]string {
if disableHostLoopback {
return map[string]string{}
}
return map[string]string{gatewayIP: "127.0.0.1"}
}
func run(ctx context.Context, g *errgroup.Group, configuration *types.Configuration) error {
vn, err := virtualnetwork.New(configuration)
gvisor-tap-vsock v0.8.9's forwarder.TCP passes the guest's destination, translated only if the NAT table names it, to net.Dial with no timeout. With the empty table the host dials 192.168.5.2:<port> on its own network. On this Mac (192.168.0.0/16 on-link) the guest got its RST after 75 s, and ten pending dials fill the forwarder's in-flight slots, so they stall every new guest TCP connection. If a LAN or VPN device holds 192.168.5.2, it gets the traffic instead.
setupEnv still rewrites a loopback proxy to the gateway (pkg/cidata/cidata.go:97-102), so proxied requests and their credentials go the same way.
continue
}
if !hostLoopback {
logrus.Warnf("%#q value %#q points at the host's loopback, which the guest cannot reach with `hostLoopback: false`", name, value)
}
newHost := slirpGateway
if u.Port() != "" {
newHost = net.JoinHostPort(newHost, u.Port())
}
u.Host = newHost
value = u.String()
}
if value != env[name] {
logrus.Infof("Replacing %#q value %#q with %#q", name, env[name], value)
env[name] = value
}
The docs (website/content/en/docs/config/network/user.md:30) and the 67a1e1be body say these connections are refused.
```yaml
hostLoopback: false
```
DNS, outbound connections to other hosts and `limactl shell` keep working. Connections to `host.lima.internal` are refused instead.
A host service that listens on all interfaces is still reachable through the host's LAN address.
A proxy on the host's loopback (for example `http_proxy=http://127.0.0.1:3128`, propagated by `propagateProxyEnv`) becomes unreachable from the guest.
`hostLoopback: false` is only supported with `vmType: vz`, and not with a [`user-v2`]({{< ref "/docs/config/network/user-v2" >}}) network.
Reproducer
// Save as pkg/networks/usernet/hostloopback_probe_test.go; run: go test ./pkg/networks/usernet/ -run TestProbe -v -count=1
// SPDX-FileCopyrightText: Copyright The Lima Authors
// SPDX-License-Identifier: Apache-2.0
package usernet
import (
"context"
"encoding/binary"
"io"
"net"
"sync"
"testing"
"time"
"github.com/containers/gvisor-tap-vsock/pkg/types"
"github.com/containers/gvisor-tap-vsock/pkg/virtualnetwork"
"github.com/google/gopacket"
"github.com/google/gopacket/layers"
"github.com/sirupsen/logrus"
)
var (
probeGuestMAC = net.HardwareAddr{0x52, 0x55, 0x55, 0, 0, 1}
probeGuestIP = net.IPv4(192, 168, 5, 15).To4()
probeGateway = net.IPv4(192, 168, 5, 2).To4()
)
// probeGuest speaks raw Ethernet frames to a real gvisor-tap-vsock virtual network,
// configured the way StartGVisorNetstack configures it, using the PR's natTable.
type probeGuest struct {
conn net.Conn
wmu sync.Mutex
mu sync.Mutex
replies map[uint16]chan string // guest source port -> "RST" / "SYN-ACK"
}
func startProbeGuest(t *testing.T, disableHostLoopback bool) *probeGuest {
logrus.SetLevel(logrus.PanicLevel)
vn, err := virtualnetwork.New(&types.Configuration{
MTU: 1500,
Subnet: "192.168.5.0/24",
GatewayIP: probeGateway.String(),
GatewayMacAddress: gatewayMacAddr,
DHCPStaticLeases: map[string]string{probeGateway.String(): gatewayMacAddr},
Forwards: map[string]string{},
NAT: natTable(probeGateway.String(), disableHostLoopback),
GatewayVirtualIPs: []string{probeGateway.String()},
})
if err != nil {
t.Fatal(err)
}
a, b := net.Pipe()
t.Cleanup(func() { a.Close(); b.Close() })
go func() { _ = vn.AcceptQemu(context.Background(), a) }()
g := &probeGuest{conn: b, replies: map[uint16]chan string{}}
go g.read()
return g
}
func (g *probeGuest) send(l ...gopacket.SerializableLayer) {
buf := gopacket.NewSerializeBuffer()
if err := gopacket.SerializeLayers(buf, gopacket.SerializeOptions{FixLengths: true, ComputeChecksums: true}, l...); err != nil {
panic(err)
}
frame := buf.Bytes()
prefix := make([]byte, 4)
binary.BigEndian.PutUint32(prefix, uint32(len(frame)))
g.wmu.Lock()
defer g.wmu.Unlock()
_, _ = g.conn.Write(append(prefix, frame...))
}
func (g *probeGuest) eth() *layers.Ethernet {
gw, _ := net.ParseMAC(gatewayMacAddr)
return &layers.Ethernet{SrcMAC: probeGuestMAC, DstMAC: gw, EthernetType: layers.EthernetTypeIPv4}
}
func (g *probeGuest) read() {
hdr := make([]byte, 4)
for {
if _, err := io.ReadFull(g.conn, hdr); err != nil {
return
}
frame := make([]byte, binary.BigEndian.Uint32(hdr))
if _, err := io.ReadFull(g.conn, frame); err != nil {
return
}
pkt := gopacket.NewPacket(frame, layers.LayerTypeEthernet, gopacket.Default)
if arp, ok := pkt.Layer(layers.LayerTypeARP).(*layers.ARP); ok && arp.Operation == layers.ARPRequest && net.IP(arp.DstProtAddress).Equal(probeGuestIP) {
reply := &layers.ARP{
AddrType: layers.LinkTypeEthernet, Protocol: layers.EthernetTypeIPv4, HwAddressSize: 6, ProtAddressSize: 4,
Operation: layers.ARPReply, SourceHwAddress: probeGuestMAC, SourceProtAddress: probeGuestIP,
DstHwAddress: arp.SourceHwAddress, DstProtAddress: arp.SourceProtAddress,
}
e := g.eth()
e.EthernetType = layers.EthernetTypeARP
e.DstMAC = arp.SourceHwAddress
go g.send(e, reply)
continue
}
if tcp, ok := pkt.Layer(layers.LayerTypeTCP).(*layers.TCP); ok {
kind := ""
switch {
case tcp.RST:
kind = "RST"
case tcp.SYN && tcp.ACK:
kind = "SYN-ACK"
}
g.mu.Lock()
ch := g.replies[uint16(tcp.DstPort)]
g.mu.Unlock()
if ch != nil && kind != "" {
select {
case ch <- kind:
default:
}
}
}
}
}
func (g *probeGuest) syn(dst net.IP, srcPort, dstPort uint16) chan string {
ch := make(chan string, 1)
g.mu.Lock()
g.replies[srcPort] = ch
g.mu.Unlock()
ip := &layers.IPv4{Version: 4, IHL: 5, TTL: 64, SrcIP: probeGuestIP, DstIP: dst.To4(), Protocol: layers.IPProtocolTCP}
tcp := &layers.TCP{SrcPort: layers.TCPPort(srcPort), DstPort: layers.TCPPort(dstPort), SYN: true, Seq: 1000, Window: 65535}
_ = tcp.SetNetworkLayerForChecksum(ip)
g.send(g.eth(), ip, tcp)
return ch
}
func closedLoopbackPort(t *testing.T) uint16 {
l, err := net.Listen("tcp4", "127.0.0.1:0")
if err != nil {
t.Fatal(err)
}
port := l.Addr().(*net.TCPAddr).Port
l.Close()
return uint16(port)
}
// A guest connecting to a closed port on host.lima.internal: how long until it hears back?
func TestProbeClosedPortReply(t *testing.T) {
for _, disable := range []bool{false, true} {
g := startProbeGuest(t, disable)
start := time.Now()
ch := g.syn(probeGateway, 40000, closedLoopbackPort(t))
select {
case kind := <-ch:
t.Logf("DisableHostLoopback=%v: %s after %.2fs", disable, kind, time.Since(start).Seconds())
case <-time.After(90 * time.Second):
t.Logf("DisableHostLoopback=%v: no reply within 90s", disable)
}
}
}
// Pending dials to host.lima.internal hold gvisor's TCP forwarder in-flight slots (limit 10),
// so a SYN to an unrelated, reachable host listener goes unanswered once ten are pending.
func TestProbeInFlightStall(t *testing.T) {
l, err := net.Listen("tcp4", "0.0.0.0:0")
if err != nil {
t.Fatal(err)
}
defer l.Close()
go func() {
for {
c, err := l.Accept()
if err != nil {
return
}
c.Close()
}
}()
u, err := net.Dial("udp4", "192.0.2.1:9") // no packet is sent; this only picks the outbound interface
if err != nil {
t.Fatal(err)
}
lanIP := u.LocalAddr().(*net.UDPAddr).IP
u.Close()
port := uint16(l.Addr().(*net.TCPAddr).Port)
for _, pending := range []int{9, 10} {
g := startProbeGuest(t, true)
for i := range pending {
g.syn(probeGateway, uint16(41000+i), uint16(18000+i))
}
time.Sleep(500 * time.Millisecond)
start := time.Now()
ch := g.syn(lanIP, 50000, port)
select {
case kind := <-ch:
t.Logf("%2d pending dials to host.lima.internal: SYN to host LAN listener %s:%d got %s after %.2fs", pending, lanIP, port, kind, time.Since(start).Seconds())
case <-time.After(5 * time.Second):
t.Logf("%2d pending dials to host.lima.internal: SYN to host LAN listener %s:%d got no reply within 5s", pending, lanIP, port)
}
}
}
// The host dials the guest's UDP destination 0.0.0.0 as is, and macOS treats 0.0.0.0 as itself.
func TestProbeUDPUnspecifiedReachesLoopback(t *testing.T) {
for _, tc := range []struct {
disable bool
dst net.IP
}{
{false, probeGateway},
{true, probeGateway},
{true, net.IPv4zero},
} {
ul, err := net.ListenUDP("udp4", &net.UDPAddr{IP: net.IPv4(127, 0, 0, 1)})
if err != nil {
t.Fatal(err)
}
g := startProbeGuest(t, tc.disable)
ip := &layers.IPv4{Version: 4, IHL: 5, TTL: 64, SrcIP: probeGuestIP, DstIP: tc.dst.To4(), Protocol: layers.IPProtocolUDP}
udp := &layers.UDP{SrcPort: 45123, DstPort: layers.UDPPort(ul.LocalAddr().(*net.UDPAddr).Port)}
_ = udp.SetNetworkLayerForChecksum(ip)
g.send(g.eth(), ip, udp, gopacket.Payload("probe"))
_ = ul.SetReadDeadline(time.Now().Add(2 * time.Second))
buf := make([]byte, 64)
n, _, err := ul.ReadFromUDP(buf)
t.Logf("DisableHostLoopback=%v dst=%s: 127.0.0.1-only UDP listener received payload=%v", tc.disable, tc.dst, err == nil && string(buf[:n]) == "probe")
ul.Close()
}
}
$ go test ./pkg/networks/usernet/ -run TestProbe -v -count=1
=== RUN TestProbeClosedPortReply
hostloopback_probe_test.go:153: DisableHostLoopback=false: RST after 0.00s
hostloopback_probe_test.go:153: DisableHostLoopback=true: RST after 75.00s
--- PASS: TestProbeClosedPortReply (75.01s)
=== RUN TestProbeInFlightStall
hostloopback_probe_test.go:195: 9 pending dials to host.lima.internal: SYN to host LAN listener 192.168.17.50:57537 got SYN-ACK after 0.00s
hostloopback_probe_test.go:197: 10 pending dials to host.lima.internal: SYN to host LAN listener 192.168.17.50:57537 got no reply within 5s
--- PASS: TestProbeInFlightStall (6.01s)
=== RUN TestProbeUDPUnspecifiedReachesLoopback
hostloopback_probe_test.go:224: DisableHostLoopback=false dst=192.168.5.2: 127.0.0.1-only UDP listener received payload=true
hostloopback_probe_test.go:224: DisableHostLoopback=true dst=192.168.5.2: 127.0.0.1-only UDP listener received payload=false
hostloopback_probe_test.go:224: DisableHostLoopback=true dst=0.0.0.0: 127.0.0.1-only UDP listener received payload=true
--- PASS: TestProbeUDPUnspecifiedReachesLoopback (2.01s)
PASS
ok github.com/lima-vm/lima/v2/pkg/networks/usernet 83.655s
Fix: map the gateway to 0.0.0.1, which macOS has no route to, so the dial fails at once; the patch also maps 0.0.0.0, for I2. With it the probe gets an RST after 0.00 s and a SYN-ACK with ten dials pending.
Patch
diff --git a/pkg/networks/usernet/gvproxy.go b/pkg/networks/usernet/gvproxy.go
index 1f72d98d..eb0afec9 100644
--- a/pkg/networks/usernet/gvproxy.go
+++ b/pkg/networks/usernet/gvproxy.go
@@ -97,10 +97,12 @@ func StartGVisorNetstack(ctx context.Context, gVisorOpts *GVisorNetstackOpts) er
// natTable returns the gateway's NAT table. By default the gateway IP maps to the host's loopback,
// so that the guest can reach host services (including ones bound to 127.0.0.1) as `host.lima.internal`.
-// The gateway still answers DNS itself without this entry.
+// The gateway answers DNS itself either way.
func natTable(gatewayIP string, disableHostLoopback bool) map[string]string {
if disableHostLoopback {
- return map[string]string{}
+ // Without an entry the host dials the gateway IP on its own network, and it treats
+ // a dial to 0.0.0.0 as one to its loopback. It has no route to 0.0.0.1, so both fail at once.
+ return map[string]string{gatewayIP: "0.0.0.1", "0.0.0.0": "0.0.0.1"}
}
return map[string]string{gatewayIP: "127.0.0.1"}
}
diff --git a/pkg/networks/usernet/gvproxy_test.go b/pkg/networks/usernet/gvproxy_test.go
index b7730563..53c0a823 100644
--- a/pkg/networks/usernet/gvproxy_test.go
+++ b/pkg/networks/usernet/gvproxy_test.go
@@ -42,7 +42,7 @@ func TestNATTable(t *testing.T) {
})
t.Run("host loopback disabled", func(t *testing.T) {
- assert.DeepEqual(t, natTable("192.168.5.2", true), map[string]string{})
+ assert.DeepEqual(t, natTable("192.168.5.2", true), map[string]string{"192.168.5.2": "0.0.0.1", "0.0.0.0": "0.0.0.1"})
})
}
# - For x86_64 guests with `vmType: qemu` on Linux (KVM), nested virtualization is controlled by the host
# (the `nested` parameter of the kvm_intel / kvm_amd module) and is exposed to the guest via `-cpu host`.
# 🟢 Builtin default: false
nestedVirtualization: null
# When false, the guest cannot reach the host's loopback services (those bound to 127.0.0.1 or
# to all interfaces) via "host.lima.internal" (192.168.5.2) on the default user-mode network.
# DNS, outbound access to other hosts and `limactl shell` keep working.
# Set this to false for a guest that runs untrusted code, such as a CI runner.
# - Only supported with `vmType: vz`. Not supported with a `user-v2` network, which is shared by instances.
# - Does not restrict the host's other addresses: a host service bound to all interfaces is still
# reachable through the host's LAN IP.
# - A proxy on the host's loopback (e.g. `http_proxy=http://127.0.0.1:3128`, propagated by
# `propagateProxyEnv`) becomes unreachable from the guest.
The UDP forwarder also dials the untranslated destination on the host, and macOS treats a dial to 0.0.0.0 as one to itself. A guest that can send raw packets can therefore deliver datagrams to any host service bound only to 127.0.0.1, with or without the NAT entry. Root can, and the issue's threat model assumes a root guest. The path predates the PR, but the PR now recommends the option for untrusted code. A TCP SYN to 0.0.0.0 did not get through in a frame probe, so only UDP is shown.
Reproducer
# Uses the probe file from I1 (pkg/networks/usernet/hostloopback_probe_test.go), which holds this test.
# Run from the repo root:
go test ./pkg/networks/usernet/ -run TestProbeUDPUnspecifiedReachesLoopback -v -count=1
$ go test ./pkg/networks/usernet/ -run TestProbeUDPUnspecifiedReachesLoopback -v -count=1
=== RUN TestProbeUDPUnspecifiedReachesLoopback
hostloopback_probe_test.go:224: DisableHostLoopback=false dst=192.168.5.2: 127.0.0.1-only UDP listener received payload=true
hostloopback_probe_test.go:224: DisableHostLoopback=true dst=192.168.5.2: 127.0.0.1-only UDP listener received payload=false
hostloopback_probe_test.go:224: DisableHostLoopback=true dst=0.0.0.0: 127.0.0.1-only UDP listener received payload=true
--- PASS: TestProbeUDPUnspecifiedReachesLoopback (2.01s)
PASS
ok github.com/lima-vm/lima/v2/pkg/networks/usernet 2.565s
Fix: the I1 patch maps 0.0.0.0 to 0.0.0.1 as well, and with it the same probe reports payload=false. Without that entry, both docs should say that UDP to 0.0.0.0 still reaches the host's loopback.
Configure, so limactl delete --force fails while hostLoopback: false is set Codex GPT 6 Astra Gemini 3.5 Flash Claude Opus 5.5¶
return err
}
if len(cfg.BlockDevices) > 0 {
return fmt.Errorf("field `blockDevices` is not supported for vmType: %s", limatype.QEMU)
}
if cfg.HostLoopback != nil && !*cfg.HostLoopback {
return fmt.Errorf("field `hostLoopback: false` is not supported for vmType: %s", limatype.QEMU)
}
for i, nw := range cfg.Networks {
if unknown := reflectutil.UnknownNonEmptyFields(nw,
"Lima",
"Socket",
Delete gets the driver through CreateConfiguredDriver before it removes anything (pkg/instance/delete.go:40), and --force does not skip that step.
return nil
}
func unregister(ctx context.Context, inst *limatype.Instance) error {
limaDriver, err := driverutil.CreateConfiguredDriver(ctx, inst, 0)
if err != nil {
return fmt.Errorf("failed to create driver instance: %w", err)
}
if err := limaDriver.Delete(ctx); err != nil {
Every driver's Configure runs validateConfig (pkg/driver/qemu/qemu_driver.go:297 for qemu). krunkit reaches it the same way, WSL2 and HCS call it directly, and vz keeps the user-v2 check there. So hostLoopback: false in _config/default.yaml or override.yaml, the natural way to set it for every VM, makes every qemu, krunkit, WSL2 and HCS instance undeletable. At the merge-base the same file only draws a "Non-strict YAML" warning, and the delete succeeds. limactl delete at both revisions agrees.
if _, ok := mountTypesUnsupported[*cfg.MountType]; ok {
return fmt.Errorf("mount type %#q is explicitly unsupported", *cfg.MountType)
}
return validateConfig(cfg)
}
func (l *LimaQemuDriver) BootScripts(_ context.Context) (map[string][]byte, error) {
return nil, nil
}
Reproducer
// Save as pkg/instance/hostloopback_delete_probe_test.go; run: go test ./pkg/instance/ -run TestProbeDeleteWithGlobalHostLoopbackFalse -v -count=1
// SPDX-FileCopyrightText: Copyright The Lima Authors
// SPDX-License-Identifier: Apache-2.0
package instance
import (
"os"
"path/filepath"
"testing"
_ "github.com/lima-vm/lima/v2/pkg/driver/qemu"
"github.com/lima-vm/lima/v2/pkg/store"
)
// A stopped qemu instance, with `hostLoopback: false` set globally in _config/default.yaml.
func TestProbeDeleteWithGlobalHostLoopbackFalse(t *testing.T) {
for _, global := range []string{"", "hostLoopback: false\n"} {
limaHome := t.TempDir()
t.Setenv("LIMA_HOME", limaHome)
instDir := filepath.Join(limaHome, "q")
if err := os.MkdirAll(filepath.Join(limaHome, "_config"), 0o700); err != nil {
t.Fatal(err)
}
if err := os.MkdirAll(instDir, 0o700); err != nil {
t.Fatal(err)
}
if err := os.WriteFile(filepath.Join(instDir, "lima.yaml"), []byte("vmType: qemu\nimages:\n- location: https://example.com/aarch64.img\n arch: aarch64\n- location: https://example.com/x86_64.img\n arch: x86_64\n"), 0o600); err != nil {
t.Fatal(err)
}
if global != "" {
if err := os.WriteFile(filepath.Join(limaHome, "_config", "default.yaml"), []byte(global), 0o600); err != nil {
t.Fatal(err)
}
}
inst, err := store.Inspect(t.Context(), "q")
if err != nil {
t.Fatal(err)
}
if len(inst.Errors) > 0 {
t.Fatalf("Inspect: %v", inst.Errors)
}
err = Delete(t.Context(), inst, true)
_, statErr := os.Stat(instDir)
t.Logf("_config/default.yaml=%q: Delete(force=true) err=%v; instance dir still exists=%v", global, err, statErr == nil)
}
}
$ go test ./pkg/instance/ -run TestProbeDeleteWithGlobalHostLoopbackFalse -v -count=1
=== RUN TestProbeDeleteWithGlobalHostLoopbackFalse
time="2026-10-06T19:46:48-07:00" level=info msg="The qemu driver process seems already stopped"
time="2026-10-06T19:46:48-07:00" level=info msg="The host agent process seems already stopped"
time="2026-10-06T19:46:48-07:00" level=info msg="Removing *.pid *.sock *.tmp under `/private/var/folders/s2/9q03h0c11_s4fdw169wqz3qc0000gn/T/TestProbeDeleteWithGlobalHostLoopbackFalse2340784397/001/q`"
hostloopback_delete_probe_test.go:45: _config/default.yaml="": Delete(force=true) err=<nil>; instance dir still exists=false
time="2026-10-06T19:46:48-07:00" level=info msg="The qemu driver process seems already stopped"
time="2026-10-06T19:46:48-07:00" level=info msg="The host agent process seems already stopped"
time="2026-10-06T19:46:48-07:00" level=info msg="Removing *.pid *.sock *.tmp under `/private/var/folders/s2/9q03h0c11_s4fdw169wqz3qc0000gn/T/TestProbeDeleteWithGlobalHostLoopbackFalse2340784397/002/q`"
hostloopback_delete_probe_test.go:45: _config/default.yaml="hostLoopback: false\n": Delete(force=true) err=failed to unregister `/private/var/folders/s2/9q03h0c11_s4fdw169wqz3qc0000gn/T/TestProbeDeleteWithGlobalHostLoopbackFalse2340784397/002/q`: failed to create driver instance: field `hostLoopback: false` is not supported for vmType: qemu; instance dir still exists=true
--- PASS: TestProbeDeleteWithGlobalHostLoopbackFalse (0.00s)
PASS
ok github.com/lima-vm/lima/v2/pkg/instance 0.574s
Fix: move each refusal to the top of the driver's Validate, which create, start, edit, restart and clone call, but not delete. With the patch the probe deletes both instances. On qemu, limactl create then writes the instance before Validate rejects the setting. The WSL2 and HCS test changes compile for Windows but did not run.
Patch
diff --git a/pkg/driver/hcs/hcs_driver_windows.go b/pkg/driver/hcs/hcs_driver_windows.go
index aa8b366a..6221e8b7 100644
--- a/pkg/driver/hcs/hcs_driver_windows.go
+++ b/pkg/driver/hcs/hcs_driver_windows.go
@@ -112,6 +112,10 @@ func (l *LimaHcsDriver) Configure(ctx context.Context, inst *limatype.Instance)
}
func (l *LimaHcsDriver) Validate(ctx context.Context) error {
+ // Configure also runs validateConfig when deleting an instance, so the check is here.
+ if cfg := l.Instance.Config; cfg != nil && cfg.HostLoopback != nil && !*cfg.HostLoopback {
+ return fmt.Errorf("field `hostLoopback: false` is not supported for vmType: %s", limatype.HCS)
+ }
return validateConfig(ctx, l.Instance.Config)
}
@@ -122,9 +126,6 @@ func validateConfig(_ context.Context, cfg *limatype.LimaYAML) error {
if len(cfg.BlockDevices) > 0 {
return fmt.Errorf("field `blockDevices` is not supported for vmType: %s", limatype.HCS)
}
- if cfg.HostLoopback != nil && !*cfg.HostLoopback {
- return fmt.Errorf("field `hostLoopback: false` is not supported for vmType: %s", limatype.HCS)
- }
// TODO: revise this list for HCS
if cfg.VMType != nil {
if unknown := reflectutil.UnknownNonEmptyFields(cfg, knownYamlProperties...); len(unknown) > 0 {
diff --git a/pkg/driver/hcs/hcs_driver_windows_test.go b/pkg/driver/hcs/hcs_driver_windows_test.go
index 4b24581f..992f0a9d 100644
--- a/pkg/driver/hcs/hcs_driver_windows_test.go
+++ b/pkg/driver/hcs/hcs_driver_windows_test.go
@@ -42,11 +42,6 @@ func TestValidateConfig(t *testing.T) {
cfg: &limatype.LimaYAML{BlockDevices: []string{"/dev/disk4"}},
expectedErr: "field `blockDevices` is not supported for vmType: hcs",
},
- {
- name: "hostLoopback false is rejected",
- cfg: &limatype.LimaYAML{HostLoopback: new(false)},
- expectedErr: "field `hostLoopback: false` is not supported for vmType: hcs",
- },
{
name: "nil config is rejected",
cfg: nil,
@@ -189,6 +184,11 @@ func TestValidate(t *testing.T) {
l.Instance.Config.TPM = new(true)
assert.ErrorContains(t, l.Validate(t.Context()), "field `tpm` is not supported")
+
+ l.Instance.Config.TPM = nil
+ l.Instance.Config.HostLoopback = new(false)
+ assert.NilError(t, validateConfig(t.Context(), l.Instance.Config))
+ assert.ErrorContains(t, l.Validate(t.Context()), "field `hostLoopback: false` is not supported for vmType: hcs")
}
func TestInfo(t *testing.T) {
diff --git a/pkg/driver/krunkit/krunkit_driver_darwin_arm64.go b/pkg/driver/krunkit/krunkit_driver_darwin_arm64.go
index 31f0aa6f..bcf6b0ab 100644
--- a/pkg/driver/krunkit/krunkit_driver_darwin_arm64.go
+++ b/pkg/driver/krunkit/krunkit_driver_darwin_arm64.go
@@ -184,6 +184,10 @@ func (l *LimaKrunkitDriver) Stop(_ context.Context) error {
}
func (l *LimaKrunkitDriver) Validate(_ context.Context) error {
+ // Configure also runs validateConfig when deleting an instance, so the check is here.
+ if cfg := l.Instance.Config; cfg != nil && cfg.HostLoopback != nil && !*cfg.HostLoopback {
+ return errors.New("`hostLoopback: false` is not supported in krunkit driver")
+ }
return validateConfig(l.Instance.Config)
}
@@ -241,9 +245,6 @@ func validateConfig(cfg *limatype.LimaYAML) error {
if cfg.TPM != nil && *cfg.TPM {
return errors.New("field `tpm` is not supported in krunkit driver")
}
- if cfg.HostLoopback != nil && !*cfg.HostLoopback {
- return errors.New("`hostLoopback: false` is not supported in krunkit driver")
- }
if cfg.NestedVirtualization != nil && *cfg.NestedVirtualization {
if macOSProductVersion.LessThan(*semver.New("15.0.0")) {
diff --git a/pkg/driver/qemu/qemu_driver.go b/pkg/driver/qemu/qemu_driver.go
index 5f9932e0..37753a85 100644
--- a/pkg/driver/qemu/qemu_driver.go
+++ b/pkg/driver/qemu/qemu_driver.go
@@ -92,6 +92,10 @@ func (l *LimaQemuDriver) Configure(_ context.Context, inst *limatype.Instance) (
}
func (l *LimaQemuDriver) Validate(ctx context.Context) error {
+ // Configure also runs validateConfig when deleting an instance, so the check is here.
+ if !limayaml.HostLoopbackEnabled(l.Instance.Config) {
+ return fmt.Errorf("field `hostLoopback: false` is not supported for vmType: %s", limatype.QEMU)
+ }
if err := validateArch(ctx, l.Instance.Config); err != nil {
return err
}
@@ -108,9 +112,6 @@ func validateConfig(cfg *limatype.LimaYAML) error {
if len(cfg.BlockDevices) > 0 {
return fmt.Errorf("field `blockDevices` is not supported for vmType: %s", limatype.QEMU)
}
- if cfg.HostLoopback != nil && !*cfg.HostLoopback {
- return fmt.Errorf("field `hostLoopback: false` is not supported for vmType: %s", limatype.QEMU)
- }
for i, nw := range cfg.Networks {
if unknown := reflectutil.UnknownNonEmptyFields(nw,
diff --git a/pkg/driver/qemu/qemu_test.go b/pkg/driver/qemu/qemu_test.go
index 4736599f..b2fe0a40 100644
--- a/pkg/driver/qemu/qemu_test.go
+++ b/pkg/driver/qemu/qemu_test.go
@@ -246,9 +246,9 @@ func TestValidateConfigRejectsBlockDevices(t *testing.T) {
assert.ErrorContains(t, err, "field `blockDevices` is not supported for vmType: qemu")
}
-func TestValidateConfigRejectsHostLoopbackFalse(t *testing.T) {
- err := validateConfig(&limatype.LimaYAML{
- HostLoopback: new(false),
- })
- assert.ErrorContains(t, err, "field `hostLoopback: false` is not supported for vmType: qemu")
+func TestValidateRejectsHostLoopbackFalse(t *testing.T) {
+ cfg := &limatype.LimaYAML{HostLoopback: new(false)}
+ assert.NilError(t, validateConfig(cfg))
+ l := &LimaQemuDriver{Instance: &limatype.Instance{Config: cfg}}
+ assert.ErrorContains(t, l.Validate(t.Context()), "field `hostLoopback: false` is not supported for vmType: qemu")
}
diff --git a/pkg/driver/vz/vz_driver_darwin.go b/pkg/driver/vz/vz_driver_darwin.go
index 15947d07..991e46f5 100644
--- a/pkg/driver/vz/vz_driver_darwin.go
+++ b/pkg/driver/vz/vz_driver_darwin.go
@@ -258,6 +258,10 @@ func (l *LimaVzDriver) BootScripts(_ context.Context) (map[string][]byte, error)
}
func (l *LimaVzDriver) Validate(_ context.Context) error {
+ // Configure also runs validateConfig when deleting an instance, so the check is here.
+ if !limayaml.HostLoopbackEnabled(l.Instance.Config) && limayaml.FirstUsernetIndex(l.Instance.Config) != -1 {
+ return errors.New("`hostLoopback: false` is not supported with a `user-v2` network, which is shared by instances")
+ }
if err := validateConfig(l.Instance.Config); err != nil {
return err
}
@@ -319,9 +323,6 @@ func validateConfig(cfg *limatype.LimaYAML) error {
}
}
}
- if !limayaml.HostLoopbackEnabled(cfg) && limayaml.FirstUsernetIndex(cfg) != -1 {
- return errors.New("`hostLoopback: false` is not supported with a `user-v2` network, which is shared by instances")
- }
if unknown := reflectutil.UnknownNonEmptyFields(cfg, knownYamlProperties...); cfg.VMType != nil && len(unknown) > 0 {
logrus.Warnf("vmType %s: ignoring %+v", *cfg.VMType, unknown)
}
diff --git a/pkg/driver/wsl2/wsl_driver_windows.go b/pkg/driver/wsl2/wsl_driver_windows.go
index dc45e1e4..bec31efb 100644
--- a/pkg/driver/wsl2/wsl_driver_windows.go
+++ b/pkg/driver/wsl2/wsl_driver_windows.go
@@ -93,6 +93,10 @@ func (l *LimaWslDriver) Configure(ctx context.Context, inst *limatype.Instance)
}
func (l *LimaWslDriver) Validate(ctx context.Context) error {
+ // Configure also runs validateConfig when deleting an instance, so the check is here.
+ if cfg := l.Instance.Config; cfg != nil && cfg.HostLoopback != nil && !*cfg.HostLoopback {
+ return fmt.Errorf("field `hostLoopback: false` is not supported for vmType: %s", limatype.WSL2)
+ }
return validateConfig(ctx, l.Instance.Config)
}
@@ -106,9 +110,6 @@ func validateConfig(_ context.Context, cfg *limatype.LimaYAML) error {
if len(cfg.BlockDevices) > 0 {
return fmt.Errorf("field `blockDevices` is not supported for vmType: %s", limatype.WSL2)
}
- if cfg.HostLoopback != nil && !*cfg.HostLoopback {
- return fmt.Errorf("field `hostLoopback: false` is not supported for vmType: %s", limatype.WSL2)
- }
// TODO: revise this list for WSL2
if cfg.VMType != nil {
if unknown := reflectutil.UnknownNonEmptyFields(cfg, knownYamlProperties...); len(unknown) > 0 {
diff --git a/pkg/driver/wsl2/wsl_driver_windows_test.go b/pkg/driver/wsl2/wsl_driver_windows_test.go
index aabacdf9..5cfe67ae 100644
--- a/pkg/driver/wsl2/wsl_driver_windows_test.go
+++ b/pkg/driver/wsl2/wsl_driver_windows_test.go
@@ -17,9 +17,12 @@ func TestValidateConfigRejectsBlockDevices(t *testing.T) {
assert.ErrorContains(t, err, "field `blockDevices` is not supported for vmType: wsl2")
}
-func TestValidateConfigRejectsHostLoopbackFalse(t *testing.T) {
- err := validateConfig(t.Context(), &limatype.LimaYAML{HostLoopback: new(false)})
- assert.ErrorContains(t, err, "field `hostLoopback: false` is not supported for vmType: wsl2")
+func TestValidateRejectsHostLoopbackFalse(t *testing.T) {
+ arch := limatype.NewArch(runtime.GOARCH)
+ cfg := &limatype.LimaYAML{Arch: &arch, HostLoopback: new(false)}
+ assert.NilError(t, validateConfig(t.Context(), cfg))
+ l := &LimaWslDriver{Instance: &limatype.Instance{Config: cfg}}
+ assert.ErrorContains(t, l.Validate(t.Context()), "field `hostLoopback: false` is not supported for vmType: wsl2")
}
func TestValidateConfigImages(t *testing.T) {
Async: true,
DefaultLeases: map[string]string{
networks.SlirpIPAddress: limayaml.MACAddress(inst.Dir),
},
Subnet: networks.SlirpNetwork,
DisableHostLoopback: !limayaml.HostLoopbackEnabled(inst.Config),
})
if err != nil {
defer cancel()
return nil, nil, err
}
TestNATTable covers only natTable. Dropping the ! here leaves host loopback reachable while the user believes it is blocked, and the suite stays green.
Deleting the user-v2 refusal (pkg/driver/vz/vz_driver_darwin.go:322-324) at the same time still leaves go test ./... green. Either regression gives a silently wrong result, so the test is required.
if f.Arch == *cfg.Arch {
return errors.New("`firmware.images` configuration is not supported for VZ driver")
}
}
}
if !limayaml.HostLoopbackEnabled(cfg) && limayaml.FirstUsernetIndex(cfg) != -1 {
return errors.New("`hostLoopback: false` is not supported with a `user-v2` network, which is shared by instances")
}
if unknown := reflectutil.UnknownNonEmptyFields(cfg, knownYamlProperties...); cfg.VMType != nil && len(unknown) > 0 {
logrus.Warnf("vmType %s: ignoring %+v", *cfg.VMType, unknown)
}
if !limatype.IsNativeArch(*cfg.Arch) {
Reproducer
# Save as mutate-vz.sh; run from the repo root: bash mutate-vz.sh
set -u
files="pkg/driver/vz/vm_darwin.go pkg/driver/vz/vz_driver_darwin.go"
for f in $files; do cp "$f" "$f.orig"; done
# 1: drop the negation, so hostLoopback: false leaves the NAT entry in place
perl -pi -e "s/DisableHostLoopback: !limayaml/DisableHostLoopback: limayaml/" pkg/driver/vz/vm_darwin.go
# 2: delete the user-v2 refusal
perl -0pi -e "s/\tif !limayaml\.HostLoopbackEnabled\(cfg\) && limayaml\.FirstUsernetIndex\(cfg\) != -1 \{\n.*?\n\t\}\n//s" pkg/driver/vz/vz_driver_darwin.go
git diff --stat -- $files
go test -count=1 ./... > mutate-vz.log 2>&1
echo "go test rc=$?"
grep "^FAIL\|^--- FAIL" mutate-vz.log || echo "no failing tests"
for f in $files; do mv "$f.orig" "$f"; done
rm mutate-vz.log
$ bash mutate-vz.sh
pkg/driver/vz/vm_darwin.go | 2 +-
pkg/driver/vz/vz_driver_darwin.go | 3 ---
2 files changed, 1 insertion(+), 4 deletions(-)
go test rc=0
no failing tests
Fix: build the gvisor options in a helper and assert DisableHostLoopback for both values, and test the user-v2 refusal through Validate, which works with and without the I3 patch. With the patch, the mutation script fails both new tests.
Patch
diff --git a/pkg/driver/vz/vm_darwin.go b/pkg/driver/vz/vm_darwin.go
index 7518d238..bd4e91ea 100644
--- a/pkg/driver/vz/vm_darwin.go
+++ b/pkg/driver/vz/vm_darwin.go
@@ -217,6 +217,21 @@ func startVM(ctx context.Context, inst *limatype.Instance, sshLocalPort int, onV
return wrapper, notifySSHLocalPortAccessible, sendErrCh, err
}
+// gvisorNetstackOpts returns the options of the instance's in-process gvisor-tap-vsock network.
+func gvisorNetstackOpts(inst *limatype.Instance, endpointSock, fdSock string) *usernet.GVisorNetstackOpts {
+ return &usernet.GVisorNetstackOpts{
+ MTU: 1500,
+ Endpoint: endpointSock,
+ FdSocket: fdSock,
+ Async: true,
+ DefaultLeases: map[string]string{
+ networks.SlirpIPAddress: limayaml.MACAddress(inst.Dir),
+ },
+ Subnet: networks.SlirpNetwork,
+ DisableHostLoopback: !limayaml.HostLoopbackEnabled(inst.Config),
+ }
+}
+
func startUsernet(ctx context.Context, inst *limatype.Instance) (*usernet.Client, context.CancelFunc, error) {
if firstUsernetIndex := limayaml.FirstUsernetIndex(inst.Config); firstUsernetIndex != -1 {
nwName := inst.Config.Networks[firstUsernetIndex].Lima
@@ -234,17 +249,7 @@ func startUsernet(ctx context.Context, inst *limatype.Instance) (*usernet.Client
os.RemoveAll(endpointSock)
os.RemoveAll(vzSock)
ctx, cancel := context.WithCancel(ctx)
- err = usernet.StartGVisorNetstack(ctx, &usernet.GVisorNetstackOpts{
- MTU: 1500,
- Endpoint: endpointSock,
- FdSocket: vzSock,
- Async: true,
- DefaultLeases: map[string]string{
- networks.SlirpIPAddress: limayaml.MACAddress(inst.Dir),
- },
- Subnet: networks.SlirpNetwork,
- DisableHostLoopback: !limayaml.HostLoopbackEnabled(inst.Config),
- })
+ err = usernet.StartGVisorNetstack(ctx, gvisorNetstackOpts(inst, endpointSock, vzSock))
if err != nil {
defer cancel()
return nil, nil, err
diff --git a/pkg/driver/vz/vz_driver_darwin_test.go b/pkg/driver/vz/vz_driver_darwin_test.go
index e7519196..1b558958 100644
--- a/pkg/driver/vz/vz_driver_darwin_test.go
+++ b/pkg/driver/vz/vz_driver_darwin_test.go
@@ -53,3 +53,20 @@ func TestRemovePIDFile(t *testing.T) {
// Removing a PID file that does not exist is not an error.
l.removePIDFile()
}
+
+func TestGVisorNetstackOptsHostLoopback(t *testing.T) {
+ for _, enabled := range []bool{true, false} {
+ inst := &limatype.Instance{Dir: t.TempDir(), Config: &limatype.LimaYAML{HostLoopback: &enabled}}
+ assert.Equal(t, gvisorNetstackOpts(inst, "", "").DisableHostLoopback, !enabled)
+ }
+}
+
+func TestValidateRejectsHostLoopbackFalseWithUsernet(t *testing.T) {
+ t.Setenv("LIMA_HOME", t.TempDir())
+ l := &LimaVzDriver{Instance: &limatype.Instance{Config: &limatype.LimaYAML{
+ Firmware: limatype.Firmware{LegacyBIOS: new(false)},
+ HostLoopback: new(false),
+ Networks: []limatype.Network{{Lima: "user-v2"}},
+ }}}
+ assert.ErrorContains(t, l.Validate(t.Context()), "not supported with a `user-v2` network")
+}
Suggestions ¶
localhost, and the second copy quotes the rewritten URL Gemini 3.1 Pro Gemini 3.5 Flash Claude Opus 5.5¶
if err != nil {
logrus.Warnf("Ignoring invalid proxy %#q=%v: %s", name, value, err)
continue
}
for _, ip := range netLookupIP(u.Hostname()) {
if !ip.IsLoopback() {
continue
}
if !hostLoopback {
logrus.Warnf("%#q value %#q points at the host's loopback, which the guest cannot reach with `hostLoopback: false`", name, value)
}
newHost := slirpGateway
if u.Port() != "" {
newHost = net.JoinHostPort(newHost, u.Port())
}
u.Host = newHost
localhost resolves to ::1 and 127.0.0.1, so the loop warns once per address. By the second pass value holds http://192.168.5.2:3128, and the warning says that address points at the host's loopback. A probe that stubs netLookupIP to both addresses and calls setupEnv with hostLoopback false logs both warnings.
Fix: break after the first loopback match, since every loopback address yields the same rewrite. With it the probe logs one warning and TestSetupEnv still passes.
Design Observations ¶
Concerns ¶
- (in-scope) Five copied denylist refusals cover the built-in drivers. An external driver from the registry sees none of them and silently ignores
hostLoopback: false, which fails open for an isolation option. An allowlist that start-time code checks, such as adriver.Info.Featuresflag, would close the class and replace the copies. It has to stay off the load path (see Acknowledged Limitations). Claude Opus 5.5 - (future) gvisor-tap-vsock v0.8.9 cannot drop traffic to a destination, so the I1 remap relies on macOS having no route to 0.0.0.1. A blocked-destination option upstream would make the refusal independent of host routing. Claude Opus 5.5 Codex GPT 6 Astra
Strengths ¶
- The default is unchanged, and every unsupported driver, plus
user-v2, rejectsfalseinstead of ignoring it. Claude Opus 5.5 Codex GPT 6 Astra Gemini 3.1 Pro Gemini 3.5 Flash - The
knownYamlPropertiesentries keep the filled-in default from triggering "ignoring" warnings on every start. Claude Opus 5.5 TestFillDefaultHostLoopbackcovers the precedence ofdefault.yaml, the instance andoverride.yaml. Claude Opus 5.5 Codex GPT 6 Astra Gemini 3.5 Flash- DNS on vz does not depend on the removed entry. vz guests resolve through gvisor's own listener on the gateway (
pkg/cidata/cidata.go:327-328), while other drivers DNAT through the gateway to the hostagent's resolver, which is why krunkit stays excluded. Codex GPT 6 Astra Gemini 3.5 Flash
Testing Assessment ¶
I ran go test ./... in the lead worktree at the review SHA: exit 0, 49 packages ok, none failed. GOOS=windows go vet is clean for pkg/driver/hcs and pkg/driver/wsl2, and both test binaries compile for Windows. Every CI check on e1cbcd18 passed; the three Netlify rule checks are neutral.
- Required: the vz wiring and the
user-v2refusal (I4). A regression gives a silently wrong result. - Optional: an
instance.Deletetest with a globalhostLoopback: false(I3). The failure names its cause every time; the I3 probe can become that test. - Optional: a
setupEnvwarning test for S1. - Dropped: the I1 and I2 probes as permanent tests. They depend on the host's routing and wait on real timeouts;
TestNATTablepins the mapping instead. - Dropped: a krunkit refusal test, since
validateConfiglooks up the krunkit binary first.
Documentation Assessment ¶
website/content/en/docs/config/network/user.md:30says connections tohost.lima.internalare refused. At the review SHA they hang or reach a LAN device (I1); with the I1 patch the sentence holds.templates/default.yaml:695says the guest cannot reach the host's loopback services, and line 698 recommends the option for untrusted code. Without the0.0.0.0entry, both overclaim (I2).- The 67a1e1be commit body repeats "refused" (I1).
Commit Structure ¶
e1cbcd18is a lint fixup of code thatfc7b27dcadded, andfc7b27dcfinishes67a1e1beby covering WSL2 and HCS. Lima squashes PRs, so fold the three into one commit before merge. Claude Opus 5.5 Gemini 3.5 FlashFixes #5574closes an issue this PR only partly addresses. The plan agreed in the issue included krunkit, the issue reportsuser-v2as affected, and the maintainer suggested QEMU'sdisable_host_loopback.Refs #5574, or follow-up issues, would keep the deferred work on the open list. Claude Opus 5.5
Acknowledged Limitations ¶
- The PR description defers krunkit,
user-v2and QEMU'sdisable_host_loopback. The code agrees, since each rejectsfalse. templates/default.yaml:700-701says a host service bound to all interfaces stays reachable through the host's LAN IP. The change does not make that worse.templates/default.yaml:702-703says a loopback proxy becomes unreachable. I1 covers where that traffic goes instead.- Do not re-suggest moving the refusals into
limayaml.Validate. It runs on every load (pkg/store/store.go:127), so a refusal there would make the instance unlistable and undeletable. - Do not re-suggest remapping the gateway to
127.0.0.2or240.0.0.1. On macOS both time out instead of failing at once (measured: 75 s and over 5 s).
Agent Performance Retro ¶
Claude Opus 5.5 ¶
Claude alone found I1, by following the forwarder past the NAT lookup to the host-side dial and probing what the host does with 192.168.5.2. It marked the guest side unproven on the grounds that no in-process test can push a guest SYN through virtualnetwork, yet a raw-frame probe does exactly that. It also raised the proxy consequence (merged into I1), the I4 test gap with mutations that held up, the external-driver fail-open concern and the Fixes #5574 note. Its one miscalibration was the teardown problem, rated a Suggestion because the merge-base supposedly rejects the key at parse time. The merge-base only warns and deletes the instance (measured), so it is I3.
Codex GPT 6 Astra ¶
Codex found I3 with a probe that compared the review head against an untouched merge-base, the strongest evidence for the regression label in this round. Its raw-frame probe against real gvisor-tap-vsock surfaced I2, which it filed as a future design concern although the PR recommends the option for untrusted code. It noted that its negative results used a 700 ms deadline and "do not prove an immediate connection refusal", but stopped there, one step short of I1. Its coverage table marks vm_darwin.go, where I4 is, as reviewed with no issues.
Gemini 3.1 Pro ¶
Gemini Pro raised one finding, the duplicate warning, as Important, with a repro that retyped the loop instead of calling setupEnv; it is S1. Its strengths section says the NAT change "seamlessly drops loopback packets", and its documentation assessment calls the docs accurate; I1 and I2 contradict both. It missed the teardown regression the other three found.
Gemini 3.5 Flash ¶
Flash found I3 but rated it Critical, and contributed to I4 and S1. Two findings were dropped. Its I1 claims instance.Create writes the instance before failing, but limactl create failed and did not leave a directory (measured), and its proposed fix would put the refusal on the load path. Its S2 asks the krunkit message to match the other drivers, but the message follows the krunkit file's own wording. It recovered from one transient quota retry. The two Gemini models agree on the duplicate warning and on crediting the NAT removal as a clean block, which counts as one opinion, not two.
Summary ¶
| Claude Opus 5.5 | Codex GPT 6 Astra | Gemini 3.1 Pro | Gemini 3.5 Flash | |
|---|---|---|---|---|
| Duration | 12m 26s | 8m 11s | 7m 01s | 12m 31s |
| Findings | 3I 1S | 2I | 1S | 2I 1S |
| Tool calls | 41 (Bash 38, Read 3) | 22 (shell 16, apply_patch 5, stdin 1) | 32 (runshellcommand 32) | 118 (readfile 39, grepsearch 36, runshellcommand 28) |
| Design observations | 5 | 4 | 2 | 5 |
| False positives | 0 | 0 | 0 | 2 |
| Unique insights | 3 | 1 | 0 | 0 |
| Files reviewed | 19 | 19 | 19 | 19 |
| Coverage misses | 0 | 3 | 9 | 2 |
| Totals | 3I 1S | 2I | 1S | 2I 1S |
| Downgraded | 0 | 0 | 1 | 2 |
| Dropped | 0 | 0 | 0 | 2 |
Claude supplied the most value: I1, I4 and most of the design notes. Codex supplied the most rigorous evidence, the merge-base comparison behind I3 and the frame probe behind I2. Both Gemini models found real issues but credited the main defect as a strength.
Reconciliation. Gemini 3.1 Pro P1 I1 (duplicate warning): important → suggestion S1. Gemini 3.5 Flash P1 C1 (teardown): critical → important I3. Gemini 3.5 Flash P1 I2 (duplicate warning): important → suggestion S1. Claude Opus 5.5 P1 S2 (teardown): suggestion → important I3. Codex GPT 6 Astra P1 design concern (UDP through 0.0.0.0): design observation → important I2. Claude Opus 5.5 P1 I2 (proxy rewrite) merged into I1. Gemini 3.5 Flash P1 I1 and S2 dropped.
Review Process Notes ¶
Skill improvements ¶
- When a change claims to block traffic by removing a rule (a NAT or port-forward entry, a route, an allowlist entry), find the code that handles that traffic once the rule is gone and drive it with a real packet or connection, timing the result. A fallthrough handler usually forwards unmatched traffic somewhere else instead of rejecting it, and a probe with a short deadline cannot tell a refusal from a hang.
- When a change adds an option documented as isolation for untrusted code, list the other addresses that reach the protected target (the unspecified address, aliases, other interfaces) and test each one, because the documented guarantee covers them all.
Repo context updates ¶
- [repo] UPDATE "Driver-specific defaults are filled in FillConfig, which runs at load":
FillConfigwas merged intoConfigure.driverutil.ResolveVMTypeonly sets and checksvmType, andstore.LoadYAMLByFilePathrunslimayaml.Validatebut no driver code.Configureruns on create, delete, snapshot and factory-reset throughCreateConfiguredDriver;Driver.Validateruns only on create (throughinstance.Prepare), start, edit, restart and clone. - [repo] UPDATE "validate.go is the single source of truth for cross-field validation": drop the claim that driver
FillConfigruns at load viaResolveVMType. State instead thatlimayaml.Validateruns on every load, so a refusal there makes an instance unlistable and undeletable, and that a driver refusal of a start-time setting belongs inDriver.Validate, never in avalidateConfigthatConfigurealso runs. - [repo] ADD: gvisor-tap-vsock's forwarder dials the guest's destination, after NAT translation, from the host with no timeout, and its TCP forwarder admits only 10 connection attempts in flight. A destination that hangs on the host therefore stalls every new guest TCP connection, and a UDP destination of 0.0.0.0 reaches the host's loopback on macOS. Check any change to the NAT table, or to which host addresses a guest may reach, against that path.
- [repo] ADD: The host resolver reaches the guest by two paths. vz guests use gvisor's own DNS listener on the gateway. On every other driver with
hostResolverenabled, the guest DNATs port 53 to the gateway at the hostagent's DNS port, and the gateway's host-loopback mapping (the gvisor NAT entry, or slirp's loopback mapping for QEMU) carries it to127.0.0.1. Removing that mapping breaks host-resolver DNS on those drivers unless DNS is rerouted.