Skip to content

filterx: fix potential use-after-free#854

Merged
MrAnno merged 1 commit intoaxoflow:mainfrom
bazsi:fix-use-after-free-with-piggy-packed-nvtable
Nov 19, 2025
Merged

filterx: fix potential use-after-free#854
MrAnno merged 1 commit intoaxoflow:mainfrom
bazsi:fix-use-after-free-with-piggy-packed-nvtable

Conversation

@bazsi
Copy link
Member

@bazsi bazsi commented Nov 18, 2025

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.

@bazsi bazsi force-pushed the fix-use-after-free-with-piggy-packed-nvtable branch from 6e9af1c to 7b3483c Compare November 19, 2025 10:00
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]>
@bazsi bazsi force-pushed the fix-use-after-free-with-piggy-packed-nvtable branch from 7b3483c to 4f796fe Compare November 19, 2025 10:14
@MrAnno MrAnno merged commit 079e8b0 into axoflow:main Nov 19, 2025
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants