]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: acme: don't unlink from acme_ctx_destroy()
authorWilliam Lallemand <wlallemand@irq6.net>
Sat, 27 Sep 2025 16:38:17 +0000 (18:38 +0200)
committerWilliam Lallemand <wlallemand@irq6.net>
Sat, 27 Sep 2025 16:52:56 +0000 (18:52 +0200)
commit406fd0ceb17c7ac9241989d865ab42330ed0cf23
treec933ef96e90f28727d404fbd7954712dfeb5115c
parent6499c0a0d5eb56ae640a50425f2fbbad3bc14f86
BUG/MINOR: acme: don't unlink from acme_ctx_destroy()

Unlinking the acme_ctx element from acme_ctx_destroy() requires to have
the element unlocked, because MT_LIST_DELETE() locks the element.

acme_ctx_destroy() frees the data from acme_ctx with the ctx still
linked and unlocked, then lock to unlink. So there's a small risk of
accessing acme_ctx from somewhere else. The only way to do that would be
to use the `acme challenge_ready` CLI command at the same time.

Fix the issue by doing a mt_list_unlock_link() and a
mt_list_unlock_self() to unlink the element under the lock, then destroy
the element.

This must be backported in 3.2.
src/acme.c