]> git.proxmox.com Git - mirror_frr.git/commit
zebra: Prevent thread usage of data after it being freed
authorDonald Sharp <sharpd@nvidia.com>
Mon, 29 Nov 2021 20:51:45 +0000 (15:51 -0500)
committerDonald Sharp <sharpd@nvidia.com>
Mon, 29 Nov 2021 20:51:45 +0000 (15:51 -0500)
commitc3343a755fb01e3be9efadad75be719a5b7a3676
treebdcabaed4e245653640b0926eb24024172a81224
parent31ccdb903ffca482c1cca5b9222204848a6cdeb1
zebra: Prevent thread usage of data after it being freed

On startup we create a thread timer event to do a rib sweep
of the system.  On shutdown we never stopped this timer and
as such we have a situation where a thread event could be run
on shutdown after the data for it has been freed.  Here is the
crash I am seeing:

(gdb) bt
(gdb)

Save the thread data in zebra_router and stop the thread so we don't
accidently do work on shutdown we don't mean to.  In this case
it happened in our topotests with some severe system load.
Essentially we happened to kill the zebra daemon just as the
graceful_restart timer popped here.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
zebra/main.c
zebra/zebra_router.c
zebra/zebra_router.h