It's possible that BgpSession::WriteReady gets called after peer
for the session has already been deleted. Prevent WriteReady from
from accessing freed memory by clearing the back pointer to the
peer in the session when the session in the peer is cleared.
The above fix is not sufficient since there's a concurrency issue
wherein BgpSession::WriteReady could try to access the peer while
the peer is trying to clear the back pointer in the session.
Fix is to enqueue sessions to a work queue in the sesison manager
when BgpSession::WriteReady is called. The work queue is processed
in the context of the bgp::Config task.
Reviewed: https:/ /review. opencontrail. org/11334 github. org/Juniper/ contrail- controller/ commit/ 35eb5306bad7087 f3514b4a16bef68 6cca30f1c0
Committed: http://
Submitter: Zuul
Branch: R2.20
commit 35eb5306bad7087 f3514b4a16bef68 6cca30f1c0
Author: Nischal Sheth <email address hidden>
Date: Fri Jun 5 13:25:13 2015 -0700
Fix concurrency issue in BgpSession: :WriteReady
It's possible that BgpSession: :WriteReady gets called after peer
for the session has already been deleted. Prevent WriteReady from
from accessing freed memory by clearing the back pointer to the
peer in the session when the session in the peer is cleared.
The above fix is not sufficient since there's a concurrency issue :WriteReady could try to access the peer while
wherein BgpSession:
the peer is trying to clear the back pointer in the session.
Fix is to enqueue sessions to a work queue in the sesison manager :WriteReady is called. The work queue is processed
when BgpSession:
in the context of the bgp::Config task.
Change-Id: I6e4c72b1367914 decddd0baf25589 446171443bd
Closes-Bug: 1462550