Skip to content

Fix H2 frame reassembly across noise_recv() read boundaries — large MapResponse corruption (mined from Csontikka/microlink) #37

Description

@fudio101

Source

Csontikka/microlink commits cbdf1603, aad403af, 533f1f88, 46e34917, 017b3588 (H2/Headscale-compatibility series, ~270 LoC changes, ported from a shipping project esphome-tailscale), plus 372ca277 (single-stream MapRequest flow, net -78 LoC, verified against both Tailscale SaaS and Headscale).

Bug

Large MapResponses spanning multiple noise_recv() reads deterministically corrupt the H2 frame stream — surfaces as an "implausible message size" error. This is a genuine protocol-correctness bug in the H2 frame reassembly logic, independent of control-plane backend (affects Tailscale's own SaaS control plane, not just Headscale) — it would affect any tailnet whose MapResponse is large enough to span read boundaries (e.g. tailnets with many peers), which is directly relevant since we use Tailscale's SaaS control plane exclusively (per UPSTREAM_PRS.md's reasoning for skipping PR #22).

Scope note

The source commits are part of a larger Headscale-compatibility series (https:// login_server, TLS Noise-key fetch, netmap-via-long-poll for Headscale ≥0.26, stream-liveness watchdog, DERP relay retry-forever) that mostly doesn't apply to us since we run Tailscale's SaaS control plane, not Headscale (same reasoning UPSTREAM_PRS.md already applies to skip PR #22 in full). Extract only the frame-reassembly fix itself — the part that's backend-independent — not the Headscale-specific transport/polling changes.

Target files

components/microlink/src/ml_coord.c.

Tier 2 — worth pulling despite the Headscale-adjacent source, but needs careful extraction of just the reassembly logic. See FORK_PRS.md row 18.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions