BUG/MAJOR: pools: second fix for incomplete backport of lockless pool fix
authorWilly Tarreau <w@1wt.eu>
Thu, 8 Jul 2021 15:05:10 +0000 (17:05 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 8 Jul 2021 15:08:32 +0000 (17:08 +0200)
commitfc54344cd6191669aaea2bd34cfc18e27ed2efab
tree3ee38c362313a9d392104e798f584be83fca1456
parent2c8b6f6f9cabd2ad9722bc579195a4fb6e775b3a
BUG/MAJOR: pools: second fix for incomplete backport of lockless pool fix

Commit bc76411e0 ("BUG/MAJOR: pools: fix possible race with free() in
the lockless variant") was missing another unprotected access to the
pool's free_list in __pool_refill_alloc() because this one was completely
dropped from 2.4 and above. There we need to loop over POOL_BUSY just like
in the __pool_free() code, otherwise we risk to insert such a POOL_BUSY
into the list.

This fix is only for 2.3 and 2.2 since 2.2 now also contains the faulty
backport of the patch above.
src/pool.c