]> git.kaiwu.me - njs.git/commit
Memory pool: allocate the block descriptor separately with the sanitizer
authorDmitry Volyntsev <xeioex@nginx.com>
Wed, 2 Sep 2026 23:12:01 +0000 (16:12 -0700)
committerDmitry Volyntsev <xeioexception@gmail.com>
Fri, 4 Sep 2026 20:54:20 +0000 (13:54 -0700)
commit5614d8ef0bd8d6ef7e6f2c2a9798cc2b1954af89
treeb4a025fd010d2148ab9a04ba6c96a4c1132eaa5c
parent647b0e28643e2593a470173eb017664e429712df
Memory pool: allocate the block descriptor separately with the sanitizer

Previously, njs_mp_alloc_large() embedded the block descriptor at the end of
the allocation for sizes which are not a power of two, so a read past the end
of an object stayed inside the malloc()ed region and was not detected by the
address sanitizer.

The fix is to always allocate the descriptor separately when the address
sanitizer is enabled.
src/njs_mp.c