[PATCH] D127163: [clang] Add -fsanitize=memtag-globals (no-op).

Mitch Phillips via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 10 15:34:22 PDT 2022


hctim marked 2 inline comments as done.
hctim added inline comments.


================
Comment at: clang/lib/Driver/ToolChains/Linux.cpp:767
+  if (IsAArch64) {
+    Res |= SanitizerKind::MemtagGlobals;
+  }
----------------
eugenis wrote:
> Hmm why are all the other memtag* not here?
Yeah, just realised this isn't necessary, looks like it's covered in `clang/lib/Driver/ToolChain.cpp:1088` (the entire bitset of `MemTag`, which is `MemtagStack | MemtagGlobals | MemtagHeap`).


================
Comment at: clang/lib/Sema/SemaDeclAttr.cpp:7892
 
+static bool isSanitizerThatUsesGlobals(StringRef Sanitizer) {
+  return Sanitizer == "address" || Sanitizer == "hwaddress" ||
----------------
eugenis wrote:
> Maybe "applies to globals"? On the other hand, MSan "applies" to globals but does not need this logic.
> 
> isSanitizerAttributeAllowedOnGlobals?
yeah, `isSanitizerAttributeAllowedOnGlobals` sounds good to me. also pulled this over to a different change adding support for `__attribute__((no_sanitize("hwaddress")))`: D127544


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D127163/new/

https://reviews.llvm.org/D127163



More information about the cfe-commits mailing list