fix memory corruption in config_cassandra_client.cc

Bug #1684310 reported by Ananth Suryanarayana
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Juniper Openstack
Status tracked in Trunk
Trunk
Fix Committed
High
Ananth Suryanarayana

Bug Description

Set element is accessed after it is erased... This can lead to control-node crash. CI has reported failures (crashes) in this test a few times already.. This is a likely suspect.

diff --git a/src/ifmap/client/config_cassandra_client.cc b/src/ifmap/client/config_cassa
index 126c62c..d3ccc7a 100644
--- a/src/ifmap/client/config_cassandra_client.cc
+++ b/src/ifmap/client/config_cassandra_client.cc
@@ -678,8 +678,8 @@ void ConfigCassandraPartition::RemoveObjReqEntries(set<string> &req_
 void ConfigCassandraPartition::RemoveObjReqEntry(string &uuid) {
     UUIDProcessSet::iterator req_it =
         uuid_read_set_.find(client()->GetUUID(uuid));
- uuid_read_set_.erase(req_it);
     delete req_it->second;
+ uuid_read_set_.erase(req_it);
 }

 bool ConfigCassandraPartition::StoreKeyIfUpdated(const string &uuid,

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] master

Review in progress for https://review.opencontrail.org/30599
Submitter: Ananth Suryanarayana (<email address hidden>)

Nischal Sheth (nsheth)
tags: added: contrail-control
Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : A change has been merged

Reviewed: https://review.opencontrail.org/30599
Committed: http://github.com/Juniper/contrail-controller/commit/aac9f8ce6a2c9a8d4fbfe0ae3a78e00891bbcd96
Submitter: Zuul (<email address hidden>)
Branch: master

commit aac9f8ce6a2c9a8d4fbfe0ae3a78e00891bbcd96
Author: Ananth Suryanarayana <email address hidden>
Date: Wed Apr 19 15:48:56 2017 -0700

Do not access set element iterator after it is erased

Change-Id: Ie025da832e063d0b7e40f6050f4c0df6420ab3a0
Closes-Bug: 1684310

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.