PA: Use system allocator in ASan even when kNoHooks.

If clients directly allocate/deallocate memory via PartitionAlloc while
memory sanitizer tools are in use and they don't specify
kNoMemoryToolOverride, we should allocate/deallocate the memory via the
system malloc/free. Previously the logic existed but only worked if
kNoHooks flag was not used.

Finally, in crrev.com/c/7136445, we unintentionally fixed the
deallocation side to free with the system allocator even when kNoHooks
flag was used. This mismatch caused the ASan error reported in
crbug.com/473308063.

This CL modify the allocation side to use system allocator even when
kNoHooks unless kNoMemoryToolOverride is set.

Bug: 473308063
Change-Id: I8a9d61a5fc748cbb23984a6fa2fc364fe8f8e4de
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7491140
Reviewed-by: Stephen Nusko <nuskos@chromium.org>
Commit-Queue: Ayumi Ono <ayumiohno@google.com>
Reviewed-by: Takashi Sakamoto <tasak@google.com>
Reviewed-by: Mikihito Matsuura <mikt@google.com>
Cr-Commit-Position: refs/heads/main@{#1571412}
NOKEYCHECK=True
GitOrigin-RevId: d3897b4382d402588007f95928db873c9f072f66
1 file changed