]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: pools: better check for size rounding overflow on registration
authorWilly Tarreau <w@1wt.eu>
Mon, 26 Jan 2026 10:18:04 +0000 (11:18 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 26 Jan 2026 10:54:14 +0000 (11:54 +0100)
commit1a3252e9569f120acfce50803f4f1a42ffabf45c
tree596df64c39be8800d1fd57a9294854df27ebe4cb
parente9e4821db52b9e2e1c01921d889d0cca8b8759b5
MEDIUM: pools: better check for size rounding overflow on registration

Certain object sizes cannot be controlled at declaration time because
the resulting object size may be slightly extended (tag, caller),
aligned and rounded up, or even doubled depending on pool settings
(e.g. if backup is used).

This patch addresses this by enlarging the type in the pool registration
to 64-bit so that no info is lost from the declaration, and extra checks
for overflows can be performed during registration after various rounding
steps. This allows to catch issues such as these ones and to report a
suitable error:

  global
      tune.http.logurilen 2147483647

  frontend
      capture request header name len 2147483647
      http-request capture src len 2147483647
      tcp-request content capture src len 2147483647
include/haproxy/pool-t.h
include/haproxy/pool.h
src/pool.c