]> git.puffer.fish Git - mirror/frr.git/commit
ospf6d: Stop crash in ospf6_write 13907/head
authorDonald Sharp <sharpd@nvidia.com>
Fri, 30 Jun 2023 19:21:43 +0000 (15:21 -0400)
committerMergify <37929162+mergify[bot]@users.noreply.github.com>
Sun, 2 Jul 2023 19:44:10 +0000 (19:44 +0000)
commitc5093677bc23b7a1b4b9a25b26db2809404690ca
tree1571ea8595219492ec941ff60052c71b71e9842c
parentc9a420b9c1ae7ddb9a2f04ea7ca09617dcbb888d
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>
(cherry picked from commit 3fa39a35ed32f32ed94c16d2884b24e0dae4a5fa)
ospf6d/ospf6_message.c