]> git.proxmox.com Git - mirror_frr.git/commit
ospf6d: Stop crash in ospf6_write
authorDonald Sharp <sharpd@nvidia.com>
Fri, 30 Jun 2023 19:21:43 +0000 (15:21 -0400)
committerDonatas Abraitis <donatas@opensourcerouting.org>
Mon, 3 Jul 2023 06:33:07 +0000 (09:33 +0300)
commit48278a95be6b826613c7431a0f8119d72109cb7c
treed329030f7963114c59e3531dacd5f3d8867733bc
parentcc8ac1da3b3077ec94a3a136354d6dae4845a746
ospf6d: Stop crash in ospf6_write

I'm seeing crashes in ospf6_write on the `assert(node)`.  The only
sequence of events that I see that could possibly cause this to happen
is this:

a) Someone has scheduled a outgoing write to the ospf6->t_write and
placed item(s) on the ospf6->oi_write_q
b) A decision is made in ospf6_send_lsupdate() to send an immediate
packet via a event_execute(..., ospf6_write,....).
c) ospf6_write is called and the oi_write_q is cleaned out.
d) the t_write event is now popped and the oi_write_q is empty
and FRR asserts on the `assert(node)` <crash>

When event_execute is called for ospf6_write, just cancel the t_write
event.  If ospf6_write has more data to send at the end of the function
it will reschedule itself.  I've only seen this crash one time and am
unable to reliably reproduce this at all.  But this is the only mechanism
that I can see that could make this happen, given how little the oi_write_q
is actually touched in code.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
ospf6d/ospf6_message.c