]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
osd: fix theoretical use-after-free of OSDMap
authorSage Weil <sage@redhat.com>
Sat, 16 Aug 2014 21:51:31 +0000 (14:51 -0700)
committerSage Weil <sage@redhat.com>
Sat, 16 Aug 2014 21:51:31 +0000 (14:51 -0700)
commit0e07f7f0459770a598d0b7684b0f176e2222f5d7
tree3bc46ef31009cf29dae204dc4306c8c2a8032749
parent44a0e3766a32c075bf03aaf277761f786d562aa8
osd: fix theoretical use-after-free of OSDMap

In practice, the map will remain pinned for a while, but this
will make coverity happy.

*** CID 1231685:  Use after free  (USE_AFTER_FREE)
/osd/OSD.cc: 6223 in OSD::handle_osd_map(MOSDMap *)()
6217
6218           if (o->test_flag(CEPH_OSDMAP_FULL))
6219            last_marked_full = e;
6220           pinned_maps.push_back(add_map(o));
6221
6222           bufferlist fbl;
>>>     CID 1231685:  Use after free  (USE_AFTER_FREE)
>>>     Calling "encode" dereferences freed pointer "o".
6223           o->encode(fbl);
6224
6225           hobject_t fulloid = get_osdmap_pobject_name(e);
6226           t.write(coll_t::META_COLL, fulloid, 0, fbl.length(), fbl);
6227           pin_map_bl(e, fbl);
6228           continue;

Signed-off-by: Sage Weil <sage@redhat.com>
src/osd/OSD.cc