Skip to content

lib: add missing hook_unregister_arg in mgmt_be_client_destroy (backport #21940)#21945

Open
mergify[bot] wants to merge 1 commit into
stable/10.5from
mergify/bp/stable/10.5/pr-21940
Open

lib: add missing hook_unregister_arg in mgmt_be_client_destroy (backport #21940)#21945
mergify[bot] wants to merge 1 commit into
stable/10.5from
mergify/bp/stable/10.5/pr-21940

Conversation

@mergify
Copy link
Copy Markdown

@mergify mergify Bot commented May 13, 2026

Issue:
mgmt_be_client_create() registers a hook on nb_notification_tree_send but mgmt_be_client_destroy() never unregisters it. During shutdown, the client struct gets freed while the hook still points to it. When the subscription wheel timer fires after that, it dispatches to mgmt_be_send_notification() with the freed pointer and crashes.

  ZEBRA: Received signal 11 (si_addr 0x108000001d0)
  libfrr.so.0(nb_notification_tree_send+0x69)
  libfrr.so.0(nb_notification_send+0x165)
  libfrr.so.0(nb_notify_subscriptions+0xb8)
  libfrr.so.0(event_call+0x81)
  in thread wheel_timer_thread scheduled from ../lib/wheel.c:50

Fix by adding hook_unregister_arg() before freeing the client.

Signed-off-by: Rajesh Varatharaj rvaratharaj@nvidia.com


This is an automatic backport of pull request #21940 done by Mergify.

mgmt_be_client_create() registers a hook on nb_notification_tree_send
but mgmt_be_client_destroy() never unregisters it. During shutdown,
the client struct gets freed while the hook still points to it. When
the subscription wheel timer fires after that, it dispatches to
mgmt_be_send_notification() with the freed pointer and crashes.

  ZEBRA: Received signal 11 (si_addr 0x108000001d0)
  libfrr.so.0(nb_notification_tree_send+0x69)
  libfrr.so.0(nb_notification_send+0x165)
  libfrr.so.0(nb_notify_subscriptions+0xb8)
  libfrr.so.0(event_call+0x81)
  in thread wheel_timer_thread scheduled from ../lib/wheel.c:50

Fix by adding hook_unregister_arg() before freeing the client.

Signed-off-by: Rajesh Varatharaj <rvaratharaj@nvidia.com>
(cherry picked from commit 89c4433)
@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented May 13, 2026

Target branch is not in the allowed branches list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant