]> 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)
committerN A <mail@interlinked.x10host.com>
Thu, 2 Jun 2022 17:20:18 +0000 (12:20 -0500)
commitea8d2ca17cc35e0dcaf9e927b15930fce8726e44
tree3edfc39d6a011f0612c49fe08b3c2be427f327cc
parent9ae06885fcbd6731399fe87cfe0f0a6c9e965113
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