mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-07-24 12:59:19 +00:00
Merge pull request #17143 from FRRouting/mergify/bp/dev/10.2/pr-17020
zebra: fix heap-use-after free on ns shutdown (backport #17020)
This commit is contained in:
commit
d8fc147d2c
@ -238,7 +238,7 @@ void zebra_finalize(struct event *dummy)
|
||||
zebra_ns_notify_close();
|
||||
|
||||
/* Final shutdown of ns resources */
|
||||
ns_walk_func(zebra_ns_final_shutdown, NULL, NULL);
|
||||
ns_walk_func(zebra_ns_kernel_shutdown, NULL, NULL);
|
||||
|
||||
zebra_rib_terminate();
|
||||
zebra_router_terminate();
|
||||
@ -251,6 +251,8 @@ void zebra_finalize(struct event *dummy)
|
||||
|
||||
label_manager_terminate();
|
||||
|
||||
ns_walk_func(zebra_ns_final_shutdown, NULL, NULL);
|
||||
|
||||
ns_terminate();
|
||||
frr_fini();
|
||||
exit(0);
|
||||
|
@ -175,6 +175,22 @@ int zebra_ns_early_shutdown(struct ns *ns,
|
||||
return NS_WALK_CONTINUE;
|
||||
}
|
||||
|
||||
/* During zebra shutdown, do kernel cleanup
|
||||
* netlink sockets, ..
|
||||
*/
|
||||
int zebra_ns_kernel_shutdown(struct ns *ns, void *param_in __attribute__((unused)),
|
||||
void **param_out __attribute__((unused)))
|
||||
{
|
||||
struct zebra_ns *zns = ns->info;
|
||||
|
||||
if (zns == NULL)
|
||||
return NS_WALK_CONTINUE;
|
||||
|
||||
kernel_terminate(zns, true);
|
||||
|
||||
return NS_WALK_CONTINUE;
|
||||
}
|
||||
|
||||
/* During zebra shutdown, do final cleanup
|
||||
* after all dataplane work is complete.
|
||||
*/
|
||||
@ -185,9 +201,7 @@ int zebra_ns_final_shutdown(struct ns *ns,
|
||||
struct zebra_ns *zns = ns->info;
|
||||
|
||||
if (zns == NULL)
|
||||
return 0;
|
||||
|
||||
kernel_terminate(zns, true);
|
||||
return NS_WALK_CONTINUE;
|
||||
|
||||
zebra_ns_delete(ns);
|
||||
|
||||
|
@ -70,6 +70,8 @@ int zebra_ns_early_shutdown(struct ns *ns,
|
||||
int zebra_ns_final_shutdown(struct ns *ns,
|
||||
void *param_in __attribute__((unused)),
|
||||
void **param_out __attribute__((unused)));
|
||||
int zebra_ns_kernel_shutdown(struct ns *ns, void *param_in __attribute__((unused)),
|
||||
void **param_out __attribute__((unused)));
|
||||
|
||||
void zebra_ns_startup_continue(struct zebra_dplane_ctx *ctx);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user