Open
Description
I was experimenting on doing checks beforehand for HWAsan in some high performance code and I realized that checking beforehand was much slower than software ASan.
That seems to be because while __asan_region_is_poisoned
has a fast path that checks the start and end before doing a slow O(n) scan, the near equivalent __hwasan_test_shadow
is always a slow O(n) byte by byte loop.
It is also a simple byte loop so, assuming page boundaries are accounted for, both could probably be converted to a fast SIMD loop like strlen or memchr. This could make it a lot more viable for checking bounds in advance.