HomeClusterLabs Projects

Fix: tools: Avoid crash in crm_simulate --profile

This commit no longer exists in the repository. It may have been part of a branch which was deleted.

Description

Fix: tools: Avoid crash in crm_simulate --profile

crm_simulate --profile crashes because of a bug in
pcmk__schedule_actions(), described below.

pcmk__schedule_actions() has a use-after-free bug if its cib argument is
the same as the current scheduler->input (or if it's an ancestor or
descendant). This is another step toward dropping that argument, and it
fixes the crash in crm_simulate --profile.

Behavior is preserved. The only caller of pcmkprofile_dir() is
crm_simulate. The scheduler object has no state except for output flags
when pcmk
profile_dir() is called. In particular,
pcmksched_have_status is not set. So we achieve equivalent behavior by
explicitly calling pcmk_reset_scheduler(), setting scheduler->input,
setting scheduler flags, and calling cluster_status() -- instead of
relying on pcmk
schedule_actions() to do all this via unpack_cib().

This is a regression that was introduced by c24e7325 (or a neighboring
commit) and has not made it into any release.

Signed-off-by: Reid Wahl <nrwahl@protonmail.com>

Details

Provenance
nrwahl2Authored on Jan 24 2025, 4:36 PM

Commit No Longer Exists

This commit no longer exists in the repository.