Thurston Dang 6ae457d0b2
[msan] Mark allocator padding as uninitialized, with new origin tag (#157187)
This is follow-up work per discussion in
https://github.com/llvm/llvm-project/pull/155944#discussion_r2311688571.

If the allocator reserves more space than the user requested (e.g.,
`malloc(7)` and `calloc(7,1)` actually have 16 bytes reserved), the
padding bytes will now be marked as uninitialized.

Padding poisoning is controlled by the existing flag `poison_in_malloc`
(which applies to all allocation functions, not only malloc).

Origin tag:
- For `calloc` or with track-origins > 1, the origin will be set as a
new tag, `ALLOC_PADDING`
- Otherwise, the existing `ALLOC` tag will be used.
- In the case of ambiguity caused by origin granularity, `ALLOC` will
take precedence.
2025-10-14 15:48:04 -07:00
..