From: Sage Weil Date: Fri, 24 May 2019 20:22:50 +0000 (-0500) Subject: osdc/Objecter: fix OSDMap leak in handle_osd_map X-Git-Tag: v15.1.0~2535^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=55d81db10aafabebb389453e7e6a10fe51b0c0a3;p=ceph.git osdc/Objecter: fix OSDMap leak in handle_osd_map 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 --- diff --git a/src/osdc/Objecter.cc b/src/osdc/Objecter.cc index 7140522237ba..a30e18028773 100644 --- a/src/osdc/Objecter.cc +++ b/src/osdc/Objecter.cc @@ -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);