Skip to content

vrf: fix loopback event leak on fini - #681

Open
chdxD1 wants to merge 1 commit into
DPDK:mainfrom
chdxD1:vrf-loopback-event-leak
Open

vrf: fix loopback event leak on fini#681
chdxD1 wants to merge 1 commit into
DPDK:mainfrom
chdxD1:vrf-loopback-event-leak

Conversation

@chdxD1

@chdxD1 chdxD1 commented Aug 4, 2026

Copy link
Copy Markdown

When netlink_vrf_del() fails, iface_vrf_fini() returns early and never calls iface_loopback_destroy(), leaking the loopback polling event allocated in iface_loopback_create().

This is hit whenever an address is configured on a VRF loopback: by the time the VRF is deleted the route is already gone, netlink_vrf_del() fails with ESRCH and logs

INFO: delete route on main failed: No such process

and LeakSanitizer reports

Direct leak of 128 byte(s) in 1 object(s) allocated from:
    #1 in event_new
    #2 in iface_loopback_create modules/infra/control/loopback.c:257

Found while writing the smoke test in #658, which is the first test to configure an address on the main VRF loopback.

Fix VRF finalization leak

  • Preserve the first cleanup error in iface_vrf_fini().
  • Continue cleanup after netlink_vrf_del() fails.
  • Always call iface_loopback_destroy() to release the polling event.

iface_vrf_fini() returns early when netlink_vrf_del() fails, skipping
iface_loopback_destroy() and leaking the loopback polling event. This
happens whenever an address is configured on the VRF loopback: the route
is already gone and netlink_vrf_del() fails with ESRCH.

Always destroy the loopback and return the first error instead.

Assisted-by: GitHub Copilot CLI:claude-opus-5
Signed-off-by: Christopher Dziomba <christopher.dziomba@telekom.de>
@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: c850616b-4c81-4908-8e15-f8348f237970

📥 Commits

Reviewing files that changed from the base of the PR and between 1f98b66 and ee2ff88.

📒 Files selected for processing (1)
  • modules/infra/control/vrf.c

📝 Walkthrough

Walkthrough

iface_vrf_fini now accumulates cleanup errors instead of returning immediately after a VRF netlink failure. It always attempts loopback destruction after netlink cleanup. It returns the recorded error after both cleanup operations.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chdxD1

chdxD1 commented Aug 4, 2026

Copy link
Copy Markdown
Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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.

1 participant