]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: snapshot: take the proxy's lock while dumping errors
authorWilly Tarreau <w@1wt.eu>
Fri, 7 Sep 2018 17:55:44 +0000 (19:55 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 7 Sep 2018 17:55:44 +0000 (19:55 +0200)
commit36b2736a6952c2853be5d729b5ca53fcc86eb2f2
tree723fc64ca8be075ad8d7a37c6a801b7bb492e7ba
parentddb68ac69eba73137350242f501b6cf7494cbaf0
BUG/MEDIUM: snapshot: take the proxy's lock while dumping errors

The proxy's lock it held while filling the error but not while dumping
it, so it's possible to dereference pointers being replaced, typically
server pointers. The risk is very low and unlikely but not inexistent.

Since "show errors" is rarely used in parallel, let's simply grab the
proxy's lock while dumping. Ideally we should use an R/W lock here but
it will not make any difference.

This patch must be backported to 1.8, but the code is in proto_http.c
there, though mostly similar.
src/proxy.c