Skip to content

lb: Skip nil slots during BPF map restore to prevent panic#44895

Merged
joamaki merged 1 commit intocilium:mainfrom
vipul-21:singhvipul/nil-slot-fix
Mar 23, 2026
Merged

lb: Skip nil slots during BPF map restore to prevent panic#44895
joamaki merged 1 commit intocilium:mainfrom
vipul-21:singhvipul/nil-slot-fix

Conversation

@vipul-21
Copy link
Copy Markdown
Contributor

@vipul-21 vipul-21 commented Mar 20, 2026

When iterating over backend slots in ResetAndRestore, some slots beyond the master's count may be nil. Accessing GetBackendID() on a nil slot causes a nil pointer dereference panic.

Add a nil check to skip nil slots during the restore loop.
This adds a guard rail in case the slot is nil to allow agent to recover and not stuck in Crashloopbackoff

Related: #44896

lb: Skip nil slots during BPF map restore to prevent panic

When iterating over backend slots in ResetAndRestore, some slots
beyond the master's count may be nil. Accessing GetBackendID() on
a nil slot causes a nil pointer dereference panic.

Add a nil check to skip nil slots during the restore loop.

Signed-off-by: Vipul Singh <singhvipul@microsoft.com>
@maintainer-s-little-helper maintainer-s-little-helper bot added the dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. label Mar 20, 2026
@vipul-21 vipul-21 marked this pull request as ready for review March 21, 2026 00:05
@vipul-21 vipul-21 requested a review from a team as a code owner March 21, 2026 00:05
@vipul-21 vipul-21 requested a review from joamaki March 21, 2026 00:05
@vipul-21
Copy link
Copy Markdown
Contributor Author

/test

Copy link
Copy Markdown
Contributor

@joamaki joamaki left a comment

Choose a reason for hiding this comment

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

Thanks!

@joamaki joamaki added the release-note/bug This PR fixes an issue in a previous release of Cilium. label Mar 23, 2026
@maintainer-s-little-helper maintainer-s-little-helper bot removed the dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. label Mar 23, 2026
@joamaki joamaki added dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. needs-backport/1.18 This PR / issue needs backporting to the v1.18 branch needs-backport/1.19 This PR / issue needs backporting to the v1.19 branch labels Mar 23, 2026
@maintainer-s-little-helper maintainer-s-little-helper bot removed the dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. label Mar 23, 2026
@joamaki joamaki enabled auto-merge March 23, 2026 08:33
@joamaki joamaki added this pull request to the merge queue Mar 23, 2026
@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 Mar 23, 2026
Merged via the queue into cilium:main with commit 0a4de7b Mar 23, 2026
83 of 85 checks passed
@tklauser tklauser mentioned this pull request Mar 24, 2026
4 tasks
@tklauser tklauser added backport-pending/1.18 The backport for Cilium 1.18.x for this PR is in progress. and removed needs-backport/1.18 This PR / issue needs backporting to the v1.18 branch labels Mar 24, 2026
@tklauser tklauser mentioned this pull request Mar 24, 2026
5 tasks
@tklauser tklauser added backport-pending/1.19 The backport for Cilium 1.19.x for this PR is in progress. and removed needs-backport/1.19 This PR / issue needs backporting to the v1.19 branch labels Mar 24, 2026
@github-actions github-actions bot added backport-done/1.18 The backport for Cilium 1.18.x for this PR is done. backport-done/1.19 The backport for Cilium 1.19.x for this PR is done. and removed backport-pending/1.18 The backport for Cilium 1.18.x for this PR is in progress. backport-pending/1.19 The backport for Cilium 1.19.x for this PR is in progress. labels Mar 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-done/1.18 The backport for Cilium 1.18.x for this PR is done. backport-done/1.19 The backport for Cilium 1.19.x for this PR is done. ready-to-merge This PR has passed all tests and received consensus from code owners to merge. 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.

3 participants