[PATCH] D103841: [compiler-rt][hwasan] Decouple use of the TLS global for getting the shadow base and using the frame record feature

Leonard Chan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 7 14:00:52 PDT 2021


leonardchan created this revision.
leonardchan added reviewers: phosek, mcgrathr, eugenis, vitalybuka.
leonardchan added a project: Sanitizers.
Herald added subscribers: hiraditya, dberris.
leonardchan requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

This allows for using the frame record feature (which uses `__hwasan_tls`) independently from however the user wants to access the shadow base, which prior was only usable if shadow wasn't accessed through the TLS variable or ifuncs.

For code that already used both the frame record feature and access shadow through `__hwasan_tls`, this change should be a no-op. The extra instructions necessary for storing to the ring buffer are only added to cases that weren't using TLS prior, and are added after getting the shadow base.

Updated tests and added an extra case to `prologue.ll` that covers this new case.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D103841

Files:
  llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp
  llvm/test/Instrumentation/HWAddressSanitizer/alloca.ll
  llvm/test/Instrumentation/HWAddressSanitizer/kernel-alloca.ll
  llvm/test/Instrumentation/HWAddressSanitizer/prologue.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D103841.350408.patch
Type: text/x-patch
Size: 6364 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210607/40918938/attachment.bin>


More information about the llvm-commits mailing list