]> git.kaiwu.me - haproxy.git/commit
DEBUG: pools: add new build option DEBUG_POOL_INTEGRITY
authorWilly Tarreau <w@1wt.eu>
Fri, 21 Jan 2022 18:00:25 +0000 (19:00 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 21 Jan 2022 18:07:48 +0000 (19:07 +0100)
commit0575d8fd760c6cd1de3d6ed66599d685a03c1873
treeac7c2c7a7111ccf930d79bcdf44b90a8f8819364
parent39ba1c3e125a9b8f61be05fb4b1cdff9068f65d3
DEBUG: pools: add new build option DEBUG_POOL_INTEGRITY

When enabled, objects picked from the cache are checked for corruption
by comparing their contents against a pattern that was placed when they
were inserted into the cache. Objects are also allocated in the reverse
order, from the oldest one to the most recent, so as to maximize the
ability to detect such a corruption. The goal is to detect writes after
free (or possibly hardware memory corruptions). Contrary to DEBUG_UAF
this cannot detect reads after free, but may possibly detect later
corruptions and will not consume extra memory. The CPU usage will
increase a bit due to the cost of filling/checking the area and for the
preference for cold cache instead of hot cache, though not as much as
with DEBUG_UAF. This option is meant to be usable in production.
Makefile
doc/internals/api/pools.txt
include/haproxy/pool-t.h
include/haproxy/pool.h
src/pool.c