]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: pools: fix bad freeing of aligned pools in UAF mode
authorWilly Tarreau <w@1wt.eu>
Mon, 13 Oct 2025 17:15:55 +0000 (19:15 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 13 Oct 2025 17:19:39 +0000 (19:19 +0200)
commit0e6a2332178037612f4ec579bb2f2ce019fa6fd2
treeb3d4595a036e3b5c65ce6c521ca9d739ebdbde41
parentfda6dc9597ebe8f7ef0bacc3674807195b971813
BUG/MEDIUM: pools: fix bad freeing of aligned pools in UAF mode

As reported by Christopher, in UAF mode memory release of aligned
objects as introduced in commit ef915e672a ("MEDIUM: pools: respect
pool alignment in allocations") does not work. The padding calculation
in the freeing code is no longer correct since it now depends on the
alignment, so munmap() fails on EINVAL. Fortunately we don't care much
about it since we know it's the low bits of the passed address, which
is much simpler to compute, since all mmaps are page-aligned.

There's no need to backport this, as this was introduced in 3.3.
include/haproxy/pool-os.h