]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
osdc/Objecter: fix OSDMap leak in handle_osd_map
authorSage Weil <sage@redhat.com>
Fri, 24 May 2019 20:22:50 +0000 (15:22 -0500)
committerSage Weil <sage@redhat.com>
Fri, 24 May 2019 20:22:50 +0000 (15:22 -0500)
If there are threads accessing osdmap unlocked they may walk into freed
memory, but that means the caller is buggy: we are holding the rwlock.

Fixes: http://tracker.ceph.com/issues/20491
Signed-off-by: Sage Weil <sage@redhat.com>
src/osdc/Objecter.cc

index 7140522237ba895467e246f09d68bf0b521abfe0..a30e18028773f351ef160d5fb25b00f0d4bdc5ca 100644 (file)
@@ -1213,6 +1213,7 @@ void Objecter::handle_osd_map(MOSDMap *m)
 
           emit_blacklist_events(*osdmap, *new_osdmap);
 
+         delete osdmap;
           osdmap = new_osdmap;
 
          logger->inc(l_osdc_map_full);