filterx: fix potential use-after-free#854
Merged
MrAnno merged 1 commit intoaxoflow:mainfrom Nov 19, 2025
Merged
Conversation
MrAnno
reviewed
Nov 18, 2025
6e9af1c to
7b3483c
Compare
The payload member is sometimes piggybacked to the end of the LogMessage struct, so even if we are taking a reference to it (using nv_table_ref) to prevent it being freed, it still is freed, if the underlying LogMessage itself is destroyed. This patch introduces a new API, log_msg_pin_payload() and log_msg_unpin_payload() that takes the required references thereby ensuring that the LogMessage is not freed either, at least as long as we have active pins. Signed-off-by: Balazs Scheidler <[email protected]>
7b3483c to
4f796fe
Compare
MrAnno
approved these changes
Nov 19, 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.
The payload member is sometimes piggybacked to the end of the LogMessage struct, so even if we are taking a reference to it to prevent it being freed, it will be, if the LogMessage itself is destroyed.
This patch introduces a new API, log_msg_get_payload() and put_payload() that takes the NVTable reference and ensures the LogMessage is not freed either until we can have potential pointers pointing into the NVTable.