Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

node_addressing: fix edge case where getDirectRouting returns nil #30757

Conversation

dylandreimerink
Copy link
Member

If we construct a nodeAddressing object with the IPv4 flag, and then call getDirectRouting while the directRoutingDevice doesn't contain an IPv4 address, it would return a nil address instead of the error condition. This can cause a panic in the caller who assumes that the IP is never nil.

Fixes: #30746

fix edge case in node addressing logic which could result in a panic

@dylandreimerink dylandreimerink added release-note/bug This PR fixes an issue in a previous release of Cilium. kind/regression This functionality worked fine before, but was broken in a newer release of Cilium. release-blocker/1.15 This issue will prevent the release of the next version of Cilium. needs-backport/1.15 This PR / issue needs backporting to the v1.15 branch labels Feb 14, 2024
@dylandreimerink dylandreimerink requested a review from a team as a code owner February 14, 2024 10:05
@maintainer-s-little-helper maintainer-s-little-helper bot added this to Needs backport from main in 1.15.1 Feb 14, 2024
@dylandreimerink
Copy link
Member Author

/test

If we construct a `nodeAddressing` object with the IPv4 flag, and then
call `getDirectRouting` while the directRoutingDevice doesn't contain
an IPv4 address, it would return a nil address instead of the failure
condition. This can cause a panic in the caller who assumes that the
IP is never nil.

Signed-off-by: Dylan Reimerink <dylan.reimerink@isovalent.com>
@dylandreimerink dylandreimerink force-pushed the feature/fix-addressfamily-directrouting branch from 16be223 to ee484a5 Compare February 14, 2024 10:49
@dylandreimerink
Copy link
Member Author

/test

@dylandreimerink dylandreimerink added this pull request to the merge queue Feb 14, 2024
Merged via the queue into cilium:main with commit afb3eb6 Feb 14, 2024
62 checks passed
@dylandreimerink dylandreimerink deleted the feature/fix-addressfamily-directrouting branch February 14, 2024 14:16
@michi-covalent michi-covalent mentioned this pull request Feb 14, 2024
5 tasks
@michi-covalent michi-covalent added backport-pending/1.15 The backport for Cilium 1.15.x for this PR is in progress. and removed needs-backport/1.15 This PR / issue needs backporting to the v1.15 branch labels Feb 14, 2024
@maintainer-s-little-helper maintainer-s-little-helper bot moved this from Needs backport from main to Backport pending to v1.15 in 1.15.1 Feb 14, 2024
@maintainer-s-little-helper maintainer-s-little-helper bot moved this from Needs backport from main to Backport pending to v1.15 in 1.15.1 Feb 14, 2024
@github-actions github-actions bot added backport-done/1.15 The backport for Cilium 1.15.x for this PR is done. and removed backport-pending/1.15 The backport for Cilium 1.15.x for this PR is in progress. labels Feb 14, 2024
@maintainer-s-little-helper maintainer-s-little-helper bot removed this from Backport pending to v1.15 in 1.15.1 Feb 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-done/1.15 The backport for Cilium 1.15.x for this PR is done. kind/regression This functionality worked fine before, but was broken in a newer release of Cilium. release-blocker/1.15 This issue will prevent the release of the next version of Cilium. release-note/bug This PR fixes an issue in a previous release of Cilium.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Agent panic allocating address
3 participants