]> git.puffer.fish Git - mirror/frr.git/commit
bgpd: Fix crash in bgp_labelpool 18144/head
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:18 +0000 (17:45 +0000)
commit00e7b27af084719e1356c5a11cafe723a8d5492c
treec7b94523c1346d7f7fdec941cbbd9438fd189d74
parent3b97f50e31614a14a7c446e420f269b878f5fdf9
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