[all-commits] [llvm/llvm-project] f57066: [HWASan] Use new IR attribute for communicating un...

Mitch Phillips via All-commits all-commits at lists.llvm.org
Fri Jun 24 12:04:38 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f57066401e45af8932d06554b12b9511bc95bc76
      https://github.com/llvm/llvm-project/commit/f57066401e45af8932d06554b12b9511bc95bc76
  Author: Mitch Phillips <31459023+hctim at users.noreply.github.com>
  Date:   2022-06-24 (Fri, 24 Jun 2022)

  Changed paths:
    M llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp
    M llvm/test/Instrumentation/HWAddressSanitizer/globals.ll

  Log Message:
  -----------
  [HWASan] Use new IR attribute for communicating unsanitized globals.

Globals that shouldn't be sanitized are currently communicated to HWASan
through the use of the llvm.asan.globals IR metadata. Now that we have
an on-GV attribute, use it.

Reviewed By: pcc

Differential Revision: https://reviews.llvm.org/D127543


  Commit: faf5e0ec737a676088649d7c13cb50f3f91a703a
      https://github.com/llvm/llvm-project/commit/faf5e0ec737a676088649d7c13cb50f3f91a703a
  Author: Mitch Phillips <31459023+hctim at users.noreply.github.com>
  Date:   2022-06-24 (Fri, 24 Jun 2022)

  Changed paths:
    M clang/lib/Sema/SemaDeclAttr.cpp
    A clang/test/CodeGen/Inputs/sanitizer-extra-source.cpp
    A clang/test/CodeGen/Inputs/sanitizer-ignorelist-global.txt
    A clang/test/CodeGen/Inputs/sanitizer-ignorelist-src.txt
    A clang/test/CodeGen/hwasan-globals.cpp
    A clang/test/CodeGen/memtag-globals.cpp
    A compiler-rt/test/hwasan/TestCases/global-with-reduction.c
    M compiler-rt/test/hwasan/TestCases/global.c

  Log Message:
  -----------
  Add no_sanitize('hwaddress') (and 'memtag', but that's a no-op).

Currently, `__attribute__((no_sanitize('hwaddress')))` is not possible. Add this piece of plumbing, and now that we properly support copying attributes between an old and a new global variable, add a regression test for the GlobalOpt bug that previously lost the attribute.

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D127544


Compare: https://github.com/llvm/llvm-project/compare/d45d707434f0...faf5e0ec737a


More information about the All-commits mailing list