]> git.puffer.fish Git - mirror/frr.git/commit
bgpd: fix race condition causing occasional assert 1668/head
authorQuentin Young <qlyoung@cumulusnetworks.com>
Mon, 18 Dec 2017 18:19:22 +0000 (13:19 -0500)
committerQuentin Young <qlyoung@cumulusnetworks.com>
Tue, 23 Jan 2018 23:51:34 +0000 (18:51 -0500)
commita127f33b977ea6e119d1b3bb94805b9d756b80a9
tree5e398a035911a147cbccdd24d96bbbbd7b0b8e01
parentd6fed381094ba34c04166b08cd16af01f6c263ea
bgpd: fix race condition causing occasional assert

If a BGP message header fails validation we send a BGP NOTIFICATION from
the I/O thread. At this time we clear the output buffer, push a
NOTIFICATION and then call the manual write function for errors. But in
between the push and the write the main thread could have pushed some
other message. Thus we need to hold the lock for the duration of the
function. TOCTTOU.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
bgpd/bgp_packet.c