[llvm] fd6dae9 - Update sanitize_* IR documentation.

Mitch Phillips via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 13 08:55:13 PDT 2022


Author: Mitch Phillips
Date: 2022-07-13T08:54:41-07:00
New Revision: fd6dae9799c49be37749f4fdd04a05269e3bb4e0

URL: https://github.com/llvm/llvm-project/commit/fd6dae9799c49be37749f4fdd04a05269e3bb4e0
DIFF: https://github.com/llvm/llvm-project/commit/fd6dae9799c49be37749f4fdd04a05269e3bb4e0.diff

LOG: Update sanitize_* IR documentation.

sanitize_none was never actually committed, and should be removed.

no_sanitize_memtag is to be removed in D128950.

sanitize_memtag is new in D128950.

Also update the comments on other no_sanitize_* to indicate that they're
impacted by the sanitizer ignorelist and the global-disable attribute.

Reviewed By: eugenis

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

Added: 
    

Modified: 
    llvm/docs/LangRef.rst

Removed: 
    


################################################################################
diff  --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst
index 57aef57fe5ae2..54ed0cc3f8d38 100644
--- a/llvm/docs/LangRef.rst
+++ b/llvm/docs/LangRef.rst
@@ -746,8 +746,8 @@ Syntax::
                          <global | constant> <Type> [<InitializerConstant>]
                          [, section "name"] [, partition "name"]
                          [, comdat [($name)]] [, align <Alignment>]
-                         [, no_sanitize] [, no_sanitize_address]
-                         [, no_sanitize_hwaddress] [, sanitize_address_dyninit]
+                         [, no_sanitize_address] [, no_sanitize_hwaddress]
+                         [, sanitize_address_dyninit] [, sanitize_memtag]
                          (, !name !N)*
 
 For example, the following defines a global in a numbered address space
@@ -2327,19 +2327,31 @@ Attributes may be set to communicate additional information about a global varia
 Unlike :ref:`function attributes <fnattrs>`, attributes on a global variable
 are grouped into a single :ref:`attribute group <attrgrp>`.
 
-``no_sanitize``
-    This attribute indicates that the global variable should not have any
-    sanitizers applied to it, either because it was in the sanitizer ignore
-    list, or it was annotated with
-    `__attribute__((disable_sanitizer_instrumentation))`.
 ``no_sanitize_address``
     This attribute indicates that the global variable should not have
     AddressSanitizer instrumentation applied to it, because it was annotated
-    with `__attribute__((no_sanitize("address")))`.
+    with `__attribute__((no_sanitize("address")))`,
+    `__attribute__((disable_sanitizer_instrumentation))`, or included in the
+    `-fsanitize-ignorelist` file.
 ``no_sanitize_hwaddress``
     This attribute indicates that the global variable should not have
     HWAddressSanitizer instrumentation applied to it, because it was annotated
-    with `__attribute__((no_sanitize("hwaddress")))`.
+    with `__attribute__((no_sanitize("hwaddress")))`,
+    `__attribute__((disable_sanitizer_instrumentation))`, or included in the
+    `-fsanitize-ignorelist` file.
+``sanitize_memtag``
+    This attribute indicates that the global variable should have AArch64 memory
+    tags (MTE) instrumentation applied to it. This attribute causes the
+    suppression of certain optimisations, like GlobalMerge, as well as ensuring
+    extra directives are emitted in the assembly and extra bits of metadata are
+    placed in the object file so that the linker can ensure the accesses are
+    protected by MTE. This attribute is added by clang when
+    `-fsanitize=memtag-globals` is provided, as long as the global is not marked
+    with `__attribute__((no_sanitize("memtag")))`,
+    `__attribute__((disable_sanitizer_instrumentation))`, or included in the
+    `-fsanitize-ignorelist` file. The AArch64 Globals Tagging pass may remove
+    this attribute when it's not possible to tag the global (e.g. it's a TLS
+    variable).
 ``sanitize_address_dyninit``
     This attribute indicates that the global variable, when instrumented with
     AddressSanitizer, should be checked for ODR violations. This attribute is


        


More information about the llvm-commits mailing list