ebpf_program: Fix rollback of program state on NmrClientAttachProvider failure#5287
Draft
Alan-Jowett wants to merge 1 commit into
Draft
ebpf_program: Fix rollback of program state on NmrClientAttachProvider failure#5287Alan-Jowett wants to merge 1 commit into
Alan-Jowett wants to merge 1 commit into
Conversation
Contributor
…r failure When NmrClientAttachProvider fails in the type-specific program information attach callback, the error path incorrectly cleared general_helper_program_data (wrong field) instead of rolling back the state that was set before the NmrClientAttachProvider call. Fix the error path to: - Reclaim extension_program_data back to the local variable so it is freed at the Done label. - Reset program->extension_program_data to NULL. - Reset program_type_specific_helper_function_count and bpf_prog_type to their default values. - Stop incorrectly clearing general_helper_program_data. Note: the program destructor (_ebpf_program_free) already frees extension_program_data, so the leak was bounded by program lifetime. The more significant issue was the stale bpf_prog_type and helper count that could affect subsequent attach attempts. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
ea5f27c to
5ab16a0
Compare
Contributor
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.
Summary
When \NmrClientAttachProvider\ fails in _ebpf_program_type_specific_program_information_attach_provider, the error path incorrectly cleared \general_helper_program_data\ (wrong field) instead of rolling back the state set before the call.
Issues Fixed
Note: The program destructor (_ebpf_program_free) already frees \�xtension_program_data, so the memory leak was bounded by program lifetime. The more significant issue was stale program state that could affect subsequent attach attempts.
Changes
Testing