Page MenuHomeFreeBSD

route: fix rtentry double free
ClosedPublic

Authored by kp on Jun 3 2025, 12:49 PM.
Tags
None
Referenced Files
F132950223: D50665.id156471.diff
Tue, Oct 21, 11:04 AM
F132950196: D50665.id156573.diff
Tue, Oct 21, 11:04 AM
F132950172: D50665.id156471.diff
Tue, Oct 21, 11:03 AM
F132950168: D50665.id156573.diff
Tue, Oct 21, 11:03 AM
F132950167: D50665.id.diff
Tue, Oct 21, 11:03 AM
F132950162: D50665.id156478.diff
Tue, Oct 21, 11:03 AM
F132933178: D50665.id156573.diff
Tue, Oct 21, 7:15 AM
F132897111: D50665.diff
Mon, Oct 20, 11:26 PM

Details

Summary

add_route_flags() frees the rtentry on error when called with the RTM_F_CREATE
flag. Don't free the rtentry a second time.

Sponsored by: Rubicon Communications, LLC ("Netgate")

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

kp requested review of this revision.Jun 3 2025, 12:49 PM
sys/net/route/route_ctl.c
676

Then isn't this access to freed rt_new?

sys/net/route/route_ctl.c
676

Good catch, I missed that one.
I think we can get away with using 'rt' here instead of 'rt_new', because rt_new should be a copy of rt.

Remove one more use of rt_new

This revision is now accepted and ready to land.Jun 5 2025, 7:36 AM
This revision was automatically updated to reflect the committed changes.