Skip to content

Commit 2f3ffff

Browse files
committed
crushtool: init with CINIT_FLAG_NO_DAEMON_ACTIONS
A change to mempool ceph#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 <[email protected]>
1 parent 5792bc7 commit 2f3ffff

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/tools/crushtool.cc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -452,9 +452,11 @@ int main(int argc, const char **argv)
452452
vector<const char *> empty_args;
453453
auto cct = global_init(NULL, empty_args, CEPH_ENTITY_TYPE_CLIENT,
454454
CODE_ENVIRONMENT_UTILITY,
455-
CINIT_FLAG_NO_DEFAULT_CONFIG_FILE);
455+
CINIT_FLAG_NO_DEFAULT_CONFIG_FILE|
456+
CINIT_FLAG_NO_DAEMON_ACTIONS);
456457
// crushtool times out occasionally when quits. so do not
457-
// release the g_ceph_context.
458+
// release the g_ceph_context. This causes other problems
459+
// see https://tracker.ceph.com/issues/71027
458460
cct->get();
459461
common_init_finish(g_ceph_context);
460462

0 commit comments

Comments
 (0)