Deep Review: 20260427-144006-pr-37
| Date | 2026-04-27 14:40 |
| Repo | rancher-sandbox/rancher-desktop-opensuse |
| Round | 1 (of target) |
| Author | @Nino-K |
| PR | #37 — Add rdd-guest socket bridge for Windows Docker socket forwarding |
| Commits | 88abad6e4 Add rdd-guest socket bridge for Windows Docker socket forwarding |
| Reviewers | Claude Opus 4.7 (effort: xhigh), Codex GPT 5.5 (effort: xhigh), Gemini 3.1 Pro (effort: default) |
| Verdict | Merge with fixes — drop the committed binary, restrict the vsock listener to host CID, and guard the type assertions before merging. |
| Wall-clock time | 22 min 3 s |
Executive Summary ¶
PR #37 introduces rdd-guest, a small Go daemon that runs in the WSL2 utility VM, listens on Hyper-V vsock port 6660, and proxies bytes to /var/run/docker.sock. The Dockerfile builds it from src/rdd-guest, the kiwi build copies it into /usr/local/bin, and config.sh enables a systemd unit gated by ConditionVirtualization=wsl so only WSL profiles activate the bridge.
The core proxy logic is sound — half-close propagation via CloseWrite() matches the Docker API's hijacked-stream contract, and the signal.NotifyContext shutdown path closes the listener cleanly. Three issues warrant fixes before merge: the listener accepts connections from any vsock CID (Critical, security), a 3.5 MB statically-linked x86-64 ELF binary slipped in alongside the source (Important, hygiene), and the halfCloser type assertions are unguarded (Important, robustness). Five smaller suggestions cover documentation drift, module hygiene, and a graceful-shutdown gap.
Structure: 1 critical, 2 important, 5 suggestions, plus design observations on the upstream-import TODO and unit ordering.
Critical Issues ¶
func main() {
ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt, syscall.SIGTERM)
defer stop()
l, err := vsock.Listen(vsockPort, nil)
if err != nil {
log.Fatalf("vsock listen: %v", err)
}
defer l.Close()
vsock.Listen with a nil config binds to VMADDR_CID_ANY, so the listener accepts connections from CID 2 (the Windows host, the intended caller) and from any process inside the same lightweight utility VM. WSL2 runs all distros — the rancher-desktop distro plus user distros such as Ubuntu — in a shared LxVM with a single kernel and a single vsock namespace. An unprivileged process in any of those distros can dial vsock.Local (CID 1) on port 6660 and reach this listener; rdd-guest runs as root and unconditionally proxies to /var/run/docker.sock, granting that process root-equivalent Docker API access and bypassing the socket's root:docker 0660 permissions.
The bridge's only legitimate caller is the Windows-side daemon over Hyper-V vsock (peer CID = VMADDR_CID_HOST). Filter on the peer CID at accept time:
conn, err := l.Accept()
if err != nil {
if ctx.Err() != nil {
return
}
log.Printf("rdd-guest: accept: %v", err)
continue
}
+ addr, ok := conn.RemoteAddr().(*vsock.Addr)
+ if !ok || addr.ContextID != vsock.Host {
+ log.Printf("rdd-guest: rejected connection from %v", conn.RemoteAddr())
+ conn.Close()
+ continue
+ }
go handleConn(conn)
Severity rests on Rancher Desktop's threat model. If multi-distro isolation is not a security boundary in this product (the user already has root in their own distro and Rancher Desktop intentionally shares Docker with sibling distros via other channels), the finding drops to defense-in-depth. Worth confirming with the daemon-side design before merging — but the check is one line and fails closed, so the safer default is to land it.
Important Issues ¶
ELF >