]> git.puffer.fish Git - mirror/frr.git/commit
bgpd: Fix crash in bgp_labelpool 18079/head
authorDonald Sharp <sharpd@nvidia.com>
Mon, 10 Feb 2025 17:02:00 +0000 (12:02 -0500)
committerDonald Sharp <sharpd@nvidia.com>
Mon, 10 Feb 2025 17:09:59 +0000 (12:09 -0500)
commit14eac319e8ae9314f5270f871106a70c4986c60c
tree4aff5b6badfbe22a7c000e071d8efb05a9badfe3
parentbaf4c1a78fe4cafdbb2cdbed030a31ea04a18c4a
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>
bgpd/bgp_label.c
bgpd/bgp_labelpool.c
bgpd/bgp_labelpool.h
bgpd/bgp_mplsvpn.c