lb: fix panic in orphan backend cleanup when addr is zero-value#44853
Merged
dylandreimerink merged 1 commit intocilium:mainfrom Mar 25, 2026
Merged
lb: fix panic in orphan backend cleanup when addr is zero-value#44853dylandreimerink merged 1 commit intocilium:mainfrom
dylandreimerink merged 1 commit intocilium:mainfrom
Conversation
fe0fcd6 to
ecab524
Compare
When a BPF map write fails (E2BIG) during service reconciliation, updateReferences is never called, leaving backendReferences stale. If a backend is later released as an orphan and then re-added, updateBackendRevision creates a new backendStates entry but did not set the addr field — leaving it as a zero-value L3n4Addr. On the next reconciliation, orphanBackends returns this entry and the agent calls orphanState.addr.IsIPv6() on the zero-value address, which panics with a nil pointer dereference. Fix this by setting s.addr = addr in updateBackendRevision so that backendStates entries always have a valid address regardless of whether updateReferences runs. Fixes: cilium#44852 Signed-off-by: Vipul Singh <singhvipul@microsoft.com>
ecab524 to
1f2f996
Compare
Contributor
Author
|
/test |
dylandreimerink
approved these changes
Mar 25, 2026
Contributor
Author
|
@tklauser we should backport this to v1.18 as well ? |
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When a BPF map write fails (E2BIG) during service reconciliation, updateReferences is never called, leaving backendReferences stale. If a backend is later released as an orphan and then re-added, updateBackendRevision creates a new backendStates entry but did not set the addr field — leaving it as a zero-value L3n4Addr.
On the next reconciliation, orphanBackends returns this entry and the agent calls orphanState.addr.IsIPv6() on the zero-value address, which panics with a nil pointer dereference.
Fix this by setting s.addr = addr in updateBackendRevision so that backendStates entries always have a valid address regardless of whether updateReferences runs.
Fixes: #44852