This tracks all the compiler/llvm changes needed for building Fuchsia with the HWASan variant.
|100–101 ↗||(On Diff #317118)|
Nit: can you move this above TSan so it's alphabetically sorted?
|222 ↗||(On Diff #317118)|
|222–229 ↗||(On Diff #317118)|
Can you move this above relative-vtables so we keep all sanitizers together?
|225 ↗||(On Diff #317118)|
I don't think this applies to Fuchsia.
It might be better to move this function to a per-platform file rather than conditionally compiling the entire body.
Add comment. Fuchsia never uses dynamic shadow, which is what this sets up in the Linux implementation.
From linux implemenation:
// Call the ifunc resolver for __hwasan_shadow and fill in its GOT entry. This // needs to be done before other ifunc resolvers (which are handled by libc) // because a resolver might read __hwasan_shadow.
Compare hwasan thread tracking implementation with asan + fuchsia implementation. HWASan uses different sanitizer machinery.
This can be replaced with a zircon-equivalent check that checks if TBI is enabled. This function is Linux-specific.
TODO: File a bug that tracks this once the TBI stuff is addressed.
See equivalent for other asan+lsan implementations. We use fuchsia sanitizer hooks instead of atexit. __sanitizer_exit_hook is what's used.
Don't define these. Move this logic into the hooks.
Ask why these are in the public header when we already have the thread hooks.
This is compiler-defined and should be abstracted out. Shouldn't have duplicate definitions.
This could probably be shared code with the Linux implementation. Move out of hwasan.
Ideally, the checks on these uninitialized globals should not be called.
Update to some feedback from first round of reviews. Minor refactoring of code that can be shared between the linux and fuchsia implementations. Still need to discuss refactoring the hwasan threads implementation.