]> git.puffer.fish Git - matthieu/frr.git/commit
bgpd: Fix crash in bgp_labelpool
authorDonald Sharp <sharpd@nvidia.com>
Mon, 10 Feb 2025 17:02:00 +0000 (12:02 -0500)
committerMergify <37929162+mergify[bot]@users.noreply.github.com>
Thu, 13 Feb 2025 17:45:22 +0000 (17:45 +0000)
commit20e543dd763c622eb7344352a92c5a9fef06981d
treebe48753582830379b5f76f7fd7af967918f077d4
parentb54519d027a0535bbe0d3fd0a8bf27873e866009
bgpd: Fix crash in bgp_labelpool

The bgp labelpool code is grabbing the vpn policy data structure.
This vpn_policy has a pointer to the bgp data structure.  If
a item placed on the bgp label pool workqueue happens to sit
there for the microsecond or so and the operator issues a
`no router bgp...` command that corresponds to the vpn_policy
bgp pointer, when the workqueue is run it will crash because
the bgp pointer is now freed and something else owns it.

Modify the labelpool code to store the vrf id associated
with the request on the workqueue.  When you wake up
if the vrf id still has a bgp pointer allow the request
to continue, else drop it.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit 14eac319e8ae9314f5270f871106a70c4986c60c)
bgpd/bgp_label.c
bgpd/bgp_labelpool.c
bgpd/bgp_labelpool.h
bgpd/bgp_mplsvpn.c