Skip to content

fix(srv6): fail closed in DSR eligibility for nil IPAM and dual-stack#26

Merged
ryskn merged 1 commit into
dev/srv6egress-v1from
fix/srv6-dsr-eligibility-failclosed
Jul 3, 2026
Merged

fix(srv6): fail closed in DSR eligibility for nil IPAM and dual-stack#26
ryskn merged 1 commit into
dev/srv6egress-v1from
fix/srv6-dsr-eligibility-failclosed

Conversation

@ryskn

@ryskn ryskn commented Jul 3, 2026

Copy link
Copy Markdown
Owner

What

Two fail-open gaps in dsrEligible:

  • the pod-backed backend check (which keeps host-network services like the apiserver off DSR) was wrapped in if s.felixServerIpam != nil, so a nil IPAM view skipped the whole guard. A security guard must not depend on a nilable field.
  • dual-stack services were accepted: buildDSRServices programs only the IPv6 ClusterIP while GetLocalService suppresses cnat for all ClusterIPs of a DSR service, so the IPv4 ClusterIP got neither path.

Fix

  • felixServerIpam == nil → fail closed (keep on cnat)
  • reject any service with an IPv4 ClusterIP (dual-stack) → keep on cnat

Review finding

Info I4 (nil-guard fail-open) + Low L5 (dual-stack blackhole). Both harden the same eligibility gate.

Test

GOOS=linux go vet ./calico-vpp-agent/services/... green (services package can't run natively on darwin: config→netlink).

Two fail-open gaps in dsrEligible:
- the pod-backed backend check (the guard that keeps host-network backed
  services like the apiserver off DSR) was wrapped in
  'if s.felixServerIpam != nil', so a nil IPAM view skipped it entirely.
  Treat nil as fail-closed: without the IPAM view we cannot verify
  backends are pod-backed, so keep the service on cnat.
- dual-stack services were accepted: buildDSRServices programs only the
  IPv6 ClusterIP while GetLocalService suppresses cnat for ALL ClusterIPs
  of a DSR service, so the IPv4 ClusterIP got neither path (blackhole).
  Reject any service with an IPv4 ClusterIP.
@ryskn ryskn merged commit 17a7157 into dev/srv6egress-v1 Jul 3, 2026
1 check passed
@ryskn ryskn deleted the fix/srv6-dsr-eligibility-failclosed branch July 3, 2026 01:32
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