]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crushtool: init with CINIT_FLAG_NO_DAEMON_ACTIONS 63092/head
authorBill Scales <bill_scales@uk.ibm.com>
Tue, 29 Apr 2025 13:33:02 +0000 (14:33 +0100)
committerBill Scales <bill_scales@uk.ibm.com>
Fri, 2 May 2025 07:15:00 +0000 (08:15 +0100)
A change to mempool https://github.com/ceph/ceph/pull/55696 has
exposed a use after free bug in crushtool during process exit
where dtors are being called to free up mempool data structures
at the same time that the ceph context service thread is trying
to update them.

This commit modifies crushtool's initialization to prevent
this (unneeded) thread from being created. See issue for more
details about why the thread was not terminiating.

Fixes: https://tracker.ceph.com/issues/71027
Signed-off-by: Bill Scales <bill_scales@uk.ibm.com>
src/tools/crushtool.cc

index a1a55422bf47c0dbb50005840cceecf46a571699..102c84730b154c42d58cad8bde34d8b9f67fa035 100644 (file)
@@ -452,9 +452,11 @@ int main(int argc, const char **argv)
   vector<const char *> empty_args;
   auto cct = global_init(NULL, empty_args, CEPH_ENTITY_TYPE_CLIENT,
                         CODE_ENVIRONMENT_UTILITY,
-                        CINIT_FLAG_NO_DEFAULT_CONFIG_FILE);
+                        CINIT_FLAG_NO_DEFAULT_CONFIG_FILE|
+                        CINIT_FLAG_NO_DAEMON_ACTIONS);
   // crushtool times out occasionally when quits. so do not
-  // release the g_ceph_context.
+  // release the g_ceph_context. This causes other problems
+  // see https://tracker.ceph.com/issues/71027
   cct->get();
   common_init_finish(g_ceph_context);