haproxy/doc/internals/api
Willy Tarreau 9192d20f02 MINOR: pools: make DEBUG_UAF a runtime setting
Since the massive pools cleanup that happened in 2.6, the pools
architecture was made quite more hierarchical and many alternate code
blocks could be moved to runtime flags set by -dM. One of them had not
been converted by then, DEBUG_UAF. It's not much more difficult actually,
since it only acts on a pair of functions indirection on the slow path
(OS-level allocator) and a default setting for the cache activation.

This patch adds the "uaf" setting to the options permitted in -dM so
that it now becomes possible to set or unset UAF at boot time without
recompiling. This is particularly convenient, because every 3 months on
average, developers ask a user to recompile haproxy with DEBUG_UAF to
understand a bug. Now it will not be needed anymore, instead the user
will only have to disable pools and enable uaf using -dMuaf. Note that
-dMuaf only disables previously enabled pools, but it remains possible
to re-enable caching by specifying the cache after, like -dMuaf,cache.
A few tests with this mode show that it can be an interesting combination
which catches significantly less UAF but will do so with much less
overhead, so it might be compatible with some high-traffic deployments.

The change is very small and isolated. It could be helpful to backport
this at least to 2.7 once confirmed not to cause build issues on exotic
systems, and even to 2.6 a bit later as this has proven to be useful
over time, and could be even more if it did not require a rebuild. If
a backport is desired, the following patches are needed as well:

  CLEANUP: pools: move the write before free to the uaf-only function
  CLEANUP: pool: only include pool-os from pool.c not pool.h
  REORG: pool: move all the OS specific code to pool-os.h
  CLEANUP: pools: get rid of CONFIG_HAP_POOLS
  DEBUG: pool: show a few examples in -dMhelp
2022-12-08 18:54:59 +01:00
..
appctx.txt CLEANUP: assorted typo fixes in the code and comments 2022-08-06 17:12:51 +02:00
buffer-api.txt DOC: internals: move some API definitions to an "api" subdirectory 2021-11-05 11:53:22 +01:00
event_hdl.txt CLEANUP: assorted typo fixes in the code and comments 2022-12-07 09:08:18 +01:00
filters.txt [RELEASE] Released version 2.5-dev13 2021-11-06 09:25:57 +01:00
htx-api.txt CLEANUP: assorted typo fixes in the code and comments 2022-10-30 17:17:56 +01:00
initcalls.txt MINOR: init: add the pre-check callback 2022-04-22 15:45:47 +02:00
ist.txt DOC: internals: document the IST API 2021-11-08 16:50:48 +01:00
layers.txt DOC: internal: add a description of the stream connectors and descriptors 2022-05-27 19:34:36 +02:00
list.txt CLEANUP: assorted typo fixes in the code and comments This is 29th iteration of typo fixes 2022-01-03 14:40:58 +01:00
pools.txt MINOR: pools: make DEBUG_UAF a runtime setting 2022-12-08 18:54:59 +01:00
scheduler.txt MINOR: task: replace task_set_affinity() with task_set_thread() 2022-07-01 19:15:14 +02:00