fix: add nil check in AddressesAsCIDRs to prevent SIGSEGV#11602
Open
majiayu000 wants to merge 1 commit intoprojectcalico:masterfrom
Open
fix: add nil check in AddressesAsCIDRs to prevent SIGSEGV#11602majiayu000 wants to merge 1 commit intoprojectcalico:masterfrom
majiayu000 wants to merge 1 commit intoprojectcalico:masterfrom
Conversation
When ExternalIP is empty in Kubernetes, a nil ip.Addr can end up in the Addresses slice of l3rrNodeInfo. The existing cleanup logic only removed emptyV4Addr and emptyV6Addr (zero-valued structs), but not nil interface values. This caused a panic (SIGSEGV) when AsCIDR() was called on a nil address at l3_route_resolver.go:166. This fix adds a nil check to the cleanup loop to filter out nil addresses before iterating and calling AsCIDR(). Fixes projectcalico#11384 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]> Signed-off-by: majiayu000 <[email protected]>
Member
|
/sem-approve |
caseydavenport
approved these changes
Dec 31, 2025
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.
Fixes #11384
Summary
AddressesAsCIDRs()to prevent null pointer dereferenceip.Addrin the Addresses slice, causing SIGSEGV whenAsCIDR()is calledChanges
l3_route_resolver.gobefore callingAsCIDR()Test plan
GOOS=linux go build ./felix/calc/GOOS=linux go test -c ./felix/calc/gofmt