summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDonatas Abraitis <donatas@opensourcerouting.org>2023-03-21 15:31:18 +0200
committerGitHub <noreply@github.com>2023-03-21 15:31:18 +0200
commitb8ef8251db6d850a05009d4c09a321ca5d49d753 (patch)
treee96e2a5863e06feb2836a71f691c11464f7f2f3f
parent8d2666fb039f8aac1f8f8a4ece92a2f4bf03200f (diff)
parente24c7991384a2e871c91a8ece5cc2324f32b0170 (diff)
Merge pull request #13072 from FRRouting/mergify/bp/stable/8.5/pr-13062
zebra: Fix for heap-use-after-free in EVPN (backport #13062)
-rw-r--r--zebra/zebra_netns_notify.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/zebra/zebra_netns_notify.c b/zebra/zebra_netns_notify.c
index 50b7ff9233..22e5c1fca3 100644
--- a/zebra/zebra_netns_notify.c
+++ b/zebra/zebra_netns_notify.c
@@ -178,6 +178,17 @@ static int zebra_ns_delete(char *name)
if_down(ifp);
}
+ if (IS_ZEBRA_IF_BOND(ifp))
+ zebra_l2if_update_bond(ifp, false);
+ if (IS_ZEBRA_IF_BOND_SLAVE(ifp))
+ zebra_l2if_update_bond_slave(ifp, IFINDEX_INTERNAL,
+ false);
+ /* Special handling for bridge or VxLAN interfaces. */
+ if (IS_ZEBRA_IF_BRIDGE(ifp))
+ zebra_l2_bridge_del(ifp);
+ else if (IS_ZEBRA_IF_VXLAN(ifp))
+ zebra_l2_vxlanif_del(ifp);
+
UNSET_FLAG(ifp->flags, IFF_UP);
if_delete_update(&ifp);
}