Skip to content

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

Merged
Jafaral merged 1 commit into
stable/10.6from
mergify/bp/stable/10.6/pr-21940
May 14, 2026
Merged

lib: add missing hook_unregister_arg in mgmt_be_client_destroy (backport #21940)#21944
Jafaral merged 1 commit into
stable/10.6from
mergify/bp/stable/10.6/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.

@frrbot frrbot Bot added the libfrr label May 13, 2026
@Jafaral Jafaral merged commit 8f028c3 into stable/10.6 May 14, 2026
17 checks passed
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.

2 participants