Skip to content

Commit

Permalink
ospf6d: Fix use after free of router in OSPFv3 ABR route calculation.
Browse files Browse the repository at this point in the history
This PR fixes FRR issue #18040. The
OSPFv3 route is locked during the ABR calculation since there are
scenarios under which it is freed. The OSPFv3 ABR computation is
sub-optimal and this PR doesn't attempt to rework it.

Signed-off-by: Acee Lindem <[email protected]>
(cherry picked from commit 06af50e)
  • Loading branch information
aceelindem authored and mergify[bot] committed Feb 26, 2025
1 parent d7106ad commit 29f545d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ospf6d/ospf6_intra.c
Original file line number Diff line number Diff line change
Expand Up @@ -2320,9 +2320,15 @@ void ospf6_intra_brouter_calculation(struct ospf6_area *oa)
zlog_info("%s: brouter %s appears via area %s",
__func__, brouter_name, oa->name);

ospf6_route_lock(brouter);
/* newly added */
if (hook_add)
(*hook_add)(brouter);
if (CHECK_FLAG(brouter->flag, OSPF6_ROUTE_WAS_REMOVED)) {
ospf6_route_unlock(brouter);
brouter = NULL;
} else
ospf6_route_unlock(brouter);
} else {
if (IS_OSPF6_DEBUG_BROUTER_SPECIFIC_ROUTER_ID(
brouter_id)
Expand Down

0 comments on commit 29f545d

Please sign in to comment.