This is an archive of the discontinued LLVM Phabricator instance.

[NewPM] Port HWASan and Kernel HWASan
ClosedPublic

Authored by leonardchan on May 8 2019, 5:46 PM.

Details

Summary

Port hardware assisted address sanitizer to new PM following the same guidelines as msan and tsan.

Changes:

  • Separate HWAddressSanitizer into a pass class and a sanitizer class.
  • Create new PM wrapper pass for the sanitizer class.
  • Use the getOrINsert pattern for some module level initialization declarations.
  • Also enable kernel-kwasan in new PM
  • Update llvm tests and add clang test.

Diff Detail

Event Timeline

leonardchan created this revision.May 8 2019, 5:46 PM
phosek added inline comments.May 8 2019, 11:23 PM
clang/lib/CodeGen/BackendUtil.cpp
956

Can you also add KernelHWAddress (akin to D61664).

llvm/lib/Passes/PassRegistry.def
238

ditto here for KHWASan

leonardchan marked 2 inline comments as done.
leonardchan retitled this revision from [NewPM] Port HWASan to [NewPM] Port HWASan and Kernel HWASan.
leonardchan edited the summary of this revision. (Show Details)
philip.pfaffe accepted this revision.EditedMay 10 2019, 12:19 PM

Nit aside, looks good!

llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp
179

There are some naming clashes here. In the other sanitizers these functions are called sanitizeFunction and initializeModule.

This revision is now accepted and ready to land.May 10 2019, 12:19 PM
This revision was automatically updated to reflect the committed changes.
leonardchan marked 2 inline comments as done.
leonardchan added inline comments.May 14 2019, 2:15 PM
llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp
179

Renamed