BUG/MINOR: pools: make DEBUG_UAF always write to the to-be-freed location
authorWilly Tarreau <w@1wt.eu>
Thu, 10 Jun 2021 15:20:19 +0000 (17:20 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 10 Jun 2021 15:46:50 +0000 (17:46 +0200)
commit9a7aa3b4a19e2117a2d31257388933f5fc0c6d4a
treefa08c70bd01fd5555e792413979beae0822df925
parentc239cde26fbf0b07abdf590b77c31154bd65c566
BUG/MINOR: pools: make DEBUG_UAF always write to the to-be-freed location

Since the code was reorganized, DEBUG_UAF was still tested in the locked
pool code despite pools being disabled when DEBUG_UAF is used. Let's move
the test to pool_put_to_os() which is the one that is always called in
this condition.

The impact is only a possible misleading analysis during a troubleshooting
session due to a missing double-frees or free of const area test that is
normally already dealt with by the underlying code anyway. In practice it's
unlikely anyone will ever notice.

This should only be backported to 2.4.
include/haproxy/pool.h
src/pool.c