]> 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:10 +0000 (17:45 +0000)
commitba721ac7f7606ac69e29efa70fddc6a51cb65f6a
treec2793dad0307514aec990a37db6f9aea1ee9c0c3
parentdcebe85aa699cf52aed4b5e7cd4c0e466c734ada
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