]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: debug: add a tainted flag when a shared library is loaded
authorWilly Tarreau <w@1wt.eu>
Sun, 19 Jun 2022 14:41:59 +0000 (16:41 +0200)
committerWilly Tarreau <w@1wt.eu>
Sun, 19 Jun 2022 15:58:32 +0000 (17:58 +0200)
commit40dde2d5c15721fe22bce7ed4272f2db454883f4
tree2a776135f133a6d9a367bb293f21c9883515c43a
parent0b7b639d7e80fc6ebec1b9a1406a9ec9dea919e9
MEDIUM: debug: add a tainted flag when a shared library is loaded

Several bug reports were caused by shared libraries being loaded by other
libraries or some Lua code. Such libraries could define alternate symbols
or include dependencies to alternate versions of a library used by haproxy,
making it very hard to understand backtraces and analyze the issue.

Let's intercept dlopen() and set a new TAINTED_SHARED_LIBS flag when it
succeeds, so that "show info" makes it visible that some external libs
were added.

The redefinition is based on the definition of RTLD_DEFAULT or RTLD_NEXT
that were previously used to detect that dlsym() is usable, since we need
it as well. This should be sufficient to catch most situations.
include/haproxy/bug.h
src/tools.c