]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: listener: Acquire proxy's lock in relax_listener() if necessary
authorChristopher Faulet <cfaulet@haproxy.com>
Thu, 20 Jul 2023 12:53:50 +0000 (14:53 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 21 Jul 2023 13:08:27 +0000 (15:08 +0200)
commitff1c803279cfc8bdee8f2e13798cd3e4d99762c0
tree362712cf0296eefe9adf21817bf8390549b4586b
parent462b54dee2411957794f082184337db8fc6ff141
BUG/MEDIUM: listener: Acquire proxy's lock in relax_listener() if necessary

Listener functions must follow a common locking pattern:

  1. Get the proxy's lock if necessary
  2. Get the protocol's lock if necessary
  3. Get the listener's lock if necessary

We must take care to respect this order to avoid any ABBA issue. However, an
issue was introduced in the commit bcad7e631 ("MINOR: listener: add
relax_listener() function"). relax_listener() gets the lisener's lock and if
resume_listener() is called, the proxy's lock is then acquired.

So to fix the issue, the proxy's lock is first acquired in relax_listener(),
if necessary.

This patch should fix the issue #2222. It must be backported as far as 2.4
because the above commit is marked to be backported there.
src/listener.c