Skip to content

Make dp_free_rib() safer#786

Open
PlagueCZ wants to merge 1 commit into
mainfrom
fix/rib-free
Open

Make dp_free_rib() safer#786
PlagueCZ wants to merge 1 commit into
mainfrom
fix/rib-free

Conversation

@PlagueCZ

Copy link
Copy Markdown
Contributor

In dp_free_vni_data() the call to dp_create_rib() can fail. If that happens, the pointer vni_data->ipv4[socket_id] will be freed, but still present. Subsequent use of this pointer will result in use-after-free bug.

Since there already was a wrapper for freeing this pointer, I simply added a set to NULL.

Sure in most cases the owning structure is immediately freed, so this could be optimized, but since such code seems to only be called rarely (VNI manipulation), I chose not to optimize, to make it cleaner.

Connected to #784

@PlagueCZ PlagueCZ requested a review from a team as a code owner June 21, 2026 19:47
@github-actions github-actions Bot added bug Something isn't working size/S labels Jun 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working size/S

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant