Skip to content

__hwasan_test_shadow/CheckAddress performance issues #94124

Open
@easyaspi314

Description

@easyaspi314

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.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions