This is an archive of the discontinued LLVM Phabricator instance.

[HWASan] Disable stack, globals and force callbacks for x86_64.
ClosedPublic

Authored by morehouse on Mar 5 2021, 12:39 PM.

Details

Summary

Subsequent patches will implement page-aliasing mode for x86_64, which
will initially only work for the primary heap allocator. We force
callback instrumentation to simplify the initial aliasing
implementation.

Diff Detail

Event Timeline

morehouse created this revision.Mar 5 2021, 12:39 PM
morehouse requested review of this revision.Mar 5 2021, 12:39 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptMar 5 2021, 12:39 PM
Herald added subscribers: llvm-commits, Restricted Project. · View Herald Transcript
vitalybuka added inline comments.Mar 5 2021, 12:59 PM
llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp
489

ClInstrumentWithCalls is per process global,
TargetTriple is per module

Usually we add member like HWAddressSanitizer::InstrumentWithCalls and initialize it according to Cl flags and other parameters.

morehouse updated this revision to Diff 328630.Mar 5 2021, 1:17 PM
  • Use per-module flags to force callbacks and disable stack.
morehouse marked an inline comment as done.Mar 5 2021, 1:18 PM
vitalybuka accepted this revision.Mar 5 2021, 2:42 PM
This revision is now accepted and ready to land.Mar 5 2021, 2:42 PM

I'm concerned about losing test coverage of stack and globals in hwasan.
Could we keep both modes until page aliasing reaches feature parity?
As an alternative, we could setup aarch64 simulator testing, or even a native aarch64 builder/tester.

I'm concerned about losing test coverage of stack and globals in hwasan.
Could we keep both modes until page aliasing reaches feature parity?
As an alternative, we could setup aarch64 simulator testing, or even a native aarch64 builder/tester.

Isn't aarch64 already tested? I see several REQUIRES: aarch64-target-arch or REQUIRES: android in tests already.

eugenis accepted this revision.Mar 8 2021, 1:04 PM

Ha. Indeed, the tests run on the android bot.
LGTM