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

Fix possible panic in the ipcache when removing the prefix labels for an unknown resource ID #25230

Merged
merged 1 commit into from
May 3, 2023

Conversation

giorio94
Copy link
Member

@giorio94 giorio94 commented May 2, 2023

This PR introduces a sanity check to avoid accessing the ipcache metadata map entry for a given prefix during removal if the corresponding resource ID was not present, since that would cause a panic.

Marking with release-note/misc since I'm not sure whether this bug could happen with "legitimate" usage. I experienced it after creating a custom endpointslice for the kubernetes service for testing purposes.

Fix possible panic in the ipcache when removing the prefix labels for an unknown resource ID

This commit introduces a sanity check to avoid accessing the ipcache
metadata map entry for a given prefix during removal if the corresponding
resource ID was not present, since that would cause a panic.

Signed-off-by: Marco Iorio <marco.iorio@isovalent.com>
@giorio94 giorio94 added kind/bug This is a bug in the Cilium logic. area/misc Impacts miscellaneous areas of the code not otherwise owned by another area. release-note/misc This PR makes changes that have no direct user impact. needs-backport/1.13 This PR / issue needs backporting to the v1.13 branch labels May 2, 2023
@giorio94 giorio94 requested a review from a team as a code owner May 2, 2023 13:52
@giorio94 giorio94 requested a review from gandro May 2, 2023 13:52
@maintainer-s-little-helper maintainer-s-little-helper bot added this to Needs backport from main in 1.13.3 May 2, 2023
@giorio94
Copy link
Member Author

giorio94 commented May 2, 2023

/test

Copy link
Member

@christarazi christarazi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally this code path should never be triggered because the upserts and removes should be symmetric, but doesn't hurt to catch this 👍

@maintainer-s-little-helper maintainer-s-little-helper bot added the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label May 3, 2023
@christarazi christarazi merged commit ee94464 into cilium:main May 3, 2023
57 checks passed
@YutaroHayakawa YutaroHayakawa mentioned this pull request May 10, 2023
14 tasks
@YutaroHayakawa YutaroHayakawa added backport-pending/1.13 The backport for Cilium 1.13.x for this PR is in progress. and removed needs-backport/1.13 This PR / issue needs backporting to the v1.13 branch labels May 10, 2023
@maintainer-s-little-helper maintainer-s-little-helper bot moved this from Needs backport from main to Backport pending to v1.13 in 1.13.3 May 10, 2023
@julianwiedmann julianwiedmann added backport-done/1.13 The backport for Cilium 1.13.x for this PR is done. and removed backport-pending/1.13 The backport for Cilium 1.13.x for this PR is in progress. labels Jul 10, 2023
@maintainer-s-little-helper maintainer-s-little-helper bot moved this from Backport pending to v1.13 to Backport done to v1.13 in 1.13.3 Jul 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/misc Impacts miscellaneous areas of the code not otherwise owned by another area. backport-done/1.13 The backport for Cilium 1.13.x for this PR is done. kind/bug This is a bug in the Cilium logic. ready-to-merge This PR has passed all tests and received consensus from code owners to merge. release-note/misc This PR makes changes that have no direct user impact.
Projects
No open projects
1.13.3
Backport done to v1.13
Development

Successfully merging this pull request may close these issues.

None yet

5 participants