]> git.ipfire.org Git - thirdparty/asterisk.git/commit
loader: Prevent deadlock using tab completion.
authorNaveen Albert <asterisk@phreaknet.org>
Tue, 3 May 2022 12:44:07 +0000 (12:44 +0000)
committerKevin Harwell <kharwell@digium.com>
Mon, 6 Jun 2022 21:51:55 +0000 (16:51 -0500)
commit61bc3a8aa13bd5d860bf0298bcf625425e2a402a
tree9c27f0d01f12778772799fc7de4e2cfea924c1ad
parentb86ce7fbb9b66b0a30c64f3638bff45b7601c65c
loader: Prevent deadlock using tab completion.

If tab completion using ast_module_helper is attempted
during startup, deadlock will ensue because the CLI
will attempt to lock the module list while it is already
locked by the loader. This causes deadlock because when
the loader tries to acquire the CLI lock, they are blocked
on each other.

Waiting for startup to complete is not feasible because
the CLI lock is acquired while waiting, so deadlock will
ensure regardless of whether or not a lock on the module
list is attempted.

To prevent deadlock, we immediately abort if tab completion
is attempted on the module list before Asterisk is fully
booted.

ASTERISK-30039 #close

Change-Id: Idd468906c512bb196631e366a8f597a0e2e9271d
include/asterisk/module.h
main/loader.c