Skip to content

Preserve app ownership across WireGuard policy reloads - #933

Merged
kasnder merged 1 commit into
masterfrom
codex/fix-wg-flow-owner
Sep 9, 2026
Merged

Preserve app ownership across WireGuard policy reloads#933
kasnder merged 1 commit into
masterfrom
codex/fix-wg-flow-owner

Conversation

@kasnder

@kasnder kasnder commented Sep 8, 2026

Copy link
Copy Markdown
Member

WireGuard policy reloads recheck the owner of established TCP connections. Android can return UID 0 for a closing connection that previously belonged to an ordinary app, causing its tracker activity to appear as “Unidentified app (UID 0)”. Device logs confirmed the same connection changing from Play Store UID 10276 to UID 0 after a reload.

Retain numeric TCP ownership in a bounded cache independent of route and blocking-policy generations. Refreshes still apply current routing and blocking decisions; fresh SYNs discard the previous owner. Uncached established connections with ambiguous UID 0 remain unresolved and fail closed. Atomic cache invalidation avoids a lifecycle race, and cached packets retain the existing route fast path.

Validation:

  • Production-bound packet-policy and owner-cache tests pass with ASan/UBSan on the host, covering IPv4/IPv6, root UID, tuple reuse, expiry, collisions and route-call counts.
  • Regression checks fail when the original attribution bug or reviewed cache/fast-path bugs are restored.
  • Android native regression binaries compile with UBSan; assembleGithubDebug passes with all four native ABIs packaged.
  • Independent Sol review completed; lifecycle and performance findings were corrected and rechecked.

Final device execution and installation remain unverified because the Pixel disconnected. Existing timeline records are not rewritten.

Retain bounded numeric owner state independently of route and blocking verdict generations. Revalidate policy against the original connection owner, reject ambiguous uncached established UID zero, and resolve fresh SYN tuples anew.

Keep cache resets atomic and preserve the established route fast path. Add production-bound attribution, root UID, tuple reuse, expiry, collision and bridge-call regressions.
@kasnder
kasnder force-pushed the codex/fix-wg-flow-owner branch from e1293c6 to 7390ddf Compare September 9, 2026 07:43
@kasnder
kasnder merged commit d672e3c into master Sep 9, 2026
3 checks passed
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