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
(cherry picked from commit 7d00077fd5bd21e13aa976e6f3221cd44ae05eea)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit 3c263c09fa4044eab257ae536e56721b20829f33)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit 2f28265b848db20569c6b14ab74ffc81f250e104)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
2 files changed