Clang: Hardware-Assisted AddressSanitizer Design Documentation
a day ago
- #memory safety
- #hardware assisted
- #address sanitizer
- HWASAN is a hardware-assisted memory safety tool similar to AddressSanitizer.
- It uses address tagging to tag memory objects and pointers with random tags.
- Memory accesses are instrumented to compare pointer tags with memory tags to detect mismatches.
- Short granules handle memory objects smaller than the tagging granularity by storing their tag in the last byte.
- Heap, stack, and global memory objects are tagged with specific strategies for each.
- HWASAN relies on hardware address tagging (AArch64) or page aliasing (x86_64), limiting its portability.
- It offers probabilistic bug detection with lower memory overhead compared to AddressSanitizer.