]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: server/cli: Fix ABBA deadlock when fqdn is set from the CLI
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 15 Jun 2021 10:01:29 +0000 (12:01 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 17 Jun 2021 14:52:14 +0000 (16:52 +0200)
commitc7b391aed21f384ac38b9f2f98239c5f1cdd1895
tree4f6efc7b14e9340da73c02b65679627073fe446f
parenta386e7882378a4bd3afdd2915fefe4bcc9fa286d
BUG/MEDIUM: server/cli: Fix ABBA deadlock when fqdn is set from the CLI

To perform servers resolution, the resolver's lock is first acquired then
the server's lock when necessary. However, when the fqdn is set via the CLI,
the opposite is performed. So, it is possible to experience an ABBA
deadlock.

To fix this bug, the server's lock is acquired and released for each
subcommand of "set server" with an exception when the fqdn is set. The
resolver's lock is first acquired. Of course, this means we must be sure to
have a resolver to lock.

This patch must be backported as far as 1.8.
reg-tests/server/cli_set_fdqn.vtc
src/server.c