Yes, that is how I normally implement my page allocator before I know about ASAN. Does ASAN also implement similar things for calls to malloc/VirtualAlloc
? If so then why though? I thought the shadow-byte mechanic was enough.
ASAN's malloc/free replacements also use shadow-bytes. They have to malloc more memory than requested to make space for the redzones, and quarantine freed memory for "free". They explain it here: https://github.com/google/sanitizers/wiki/AddressSanitizerAlgorithm#malloc