]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: proxy: ensure pause_proxy() and resume_proxy() own PROXY_LOCK
authorAurelien DARRAGON <adarragon@haproxy.com>
Thu, 8 Sep 2022 12:35:35 +0000 (14:35 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 9 Sep 2022 15:23:01 +0000 (17:23 +0200)
commit7d00077fd5bd21e13aa976e6f3221cd44ae05eea
treea83efe05db51c1b7401ca575315bb5641483b002
parent6edae6ff482ac23e3a3ca7a40ef4558237b0cfd0
BUG/MEDIUM: proxy: ensure pause_proxy() and resume_proxy() own PROXY_LOCK

There was a race involving hlua_proxy_* functions
and some proxy management functions.

pause_proxy() and resume_proxy() can be used directly from lua code,
but that could lead to some race as lua code didn't make sure PROXY_LOCK
was owned before calling the proxy functions.

This patch makes sure it won't happen again elsewhere in the code
by locking PROXY_LOCK directly in resume and pause proxy functions
so that it's not the caller's responsibility anymore.
(based on stop_proxy() behavior that was already safe prior to the patch)

This should be backported to stable series.
Note that the API will likely differ < 2.4
src/hlua_fcn.c
src/proxy.c