Skip to content

Fix golden snapshot virtio-net virtqueue corruption#64

Merged
motatoes merged 1 commit intomainfrom
fix/golden-snapshot-virtqueue-corruption
Mar 13, 2026
Merged

Fix golden snapshot virtio-net virtqueue corruption#64
motatoes merged 1 commit intomainfrom
fix/golden-snapshot-virtqueue-corruption

Conversation

@motatoes
Copy link
Contributor

Summary

  • Bring the host-side TAP device down before flushing the guest eth0 during golden snapshot creation
  • Fixes a race where the host pushes ARP/IPv6 ND packets into the virtio-net RX ring between the guest flush and VM pause, corrupting the virtqueue state
  • Without this fix, restored VMs get virtio_net virtio2: input.0:id 0 is not a head! (vq->broken=true) which permanently breaks networking for every sandbox created from the golden snapshot

Root cause

During PrepareGoldenSnapshot(), the quiesce sequence was:

  1. Guest: ip addr flush dev eth0 && ip link set eth0 down
  2. Close agent, sleep 500ms
  3. Pause VM + snapshot

The host-side TAP remained up, allowing packets to enter the RX ring during steps 1-3. The fix adds ip link set <TAP> down on the host before step 1.

Test plan

  • Verified on prod: restarted worker, created sandbox, confirmed ping/DNS/HTTPS all work
  • Deploy this fix and verify golden snapshot survives multiple worker restarts without virtqueue corruption

🤖 Generated with Claude Code

Bring the host-side TAP device down before flushing the guest eth0
during golden snapshot creation. Without this, the host can push
ARP/IPv6 ND packets into the virtio-net RX ring between the guest
flush and the VM pause, corrupting the virtqueue state. On restore
every sandbox gets "input.0:id 0 is not a head!" (vq->broken=true)
which permanently breaks networking.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@vercel
Copy link

vercel bot commented Mar 13, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
opensandbox Ready Ready Preview, Comment Mar 13, 2026 5:20am

Request Review

@motatoes motatoes marked this pull request as ready for review March 13, 2026 05:28
@motatoes motatoes merged commit 4a8fd0e into main Mar 13, 2026
3 checks passed
@github-actions
Copy link

Preview Environment Destroyed

The preview environment dev-pr-64 has been torn down.
All AWS resources for this environment have been cleaned up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant