Android HW-assisted Address Sanitizer for Memory Overflow checking
Hardware-assisted AddressSanitizer (HWASan) is a memory error detection tool.
HWASan is based on the memory tagging approach, where a small random tag value is associated both with pointers and with ranges of memory addresses. For a memory access to be valid, the pointer and memory tags have to match.
HWASan uses a lot less RAM compared to ASan, which makes it suitable for whole system sanitization.
Here show an example: Use HWAsan for WiFi-HAL Memory Overflow issue hunting in Android-13.0.0_2.3.0_auto BSP.
Test environment:
SW: Android-13.0.0_2.3.0_auto_car2, pre-built image.
HW: 88W9098 WiFi/BT EVK (PCIe) + i.MX8QXP EVK.
Run 88W9098 WiFi/BT on i.MX8QXP EVK, after ~2 hours, got memory leakage.
To locate root cause, enabled HWASan, re-build Android-13.0.0_2.3.0_auto BSP, run again, Got HWAddressSanitizer report: “heap-buffer-overflow”.
--Reason> "Empty or null ScanResult list" ->
--Then> "Attempt to retrieve OsuProviders with invalid scanResult List" ->
--Result> "heap-buffer-overflow"
HWASan help to locate root cause of Memory Overflow issue, on WiFi AP Scan code.
Attach file:
"Android_HW-assisted-Address-Sanitizer_for_memory-overflow_checking.pdf"