[all-commits] [llvm/llvm-project] 97c222: [SanitizerBinaryMetadata] Introduce SanitizerBinar...

Marco Elver via All-commits all-commits at lists.llvm.org
Wed Sep 7 12:26:46 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 97c2220565abcef6c3fd674dcca98f7176e132c5
      https://github.com/llvm/llvm-project/commit/97c2220565abcef6c3fd674dcca98f7176e132c5
  Author: Marco Elver <elver at google.com>
  Date:   2022-09-07 (Wed, 07 Sep 2022)

  Changed paths:
    M llvm/include/llvm/Transforms/Instrumentation.h
    A llvm/include/llvm/Transforms/Instrumentation/SanitizerBinaryMetadata.h
    M llvm/lib/Passes/PassBuilder.cpp
    M llvm/lib/Passes/PassRegistry.def
    M llvm/lib/Transforms/Instrumentation/CMakeLists.txt
    A llvm/lib/Transforms/Instrumentation/SanitizerBinaryMetadata.cpp
    A llvm/test/Instrumentation/SanitizerBinaryMetadata/atomics.ll

  Log Message:
  -----------
  [SanitizerBinaryMetadata] Introduce SanitizerBinaryMetadata instrumentation pass

Introduces the SanitizerBinaryMetadata instrumentation pass which uses
the new MD_pcsections metadata kinds to instrument certain types of
instructions and functions required for breakpoint-based sanitizers.

The first intended user of the binary metadata emitted will be a variant
of GWP-TSan [1]. GWP-TSan will require information about atomic
accesses; to unambiguously determine if an access is atomic or not, we
also require "covered" information which code has been compiled with
SanitizerBinaryMetadata instrumentation enabled.

[1] https://llvm.org/devmtg/2020-09/slides/Morehouse-GWP-Tsan.pdf

Reviewed By: dvyukov

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


  Commit: c4842bb2e98e2f1ee23bb3bc753752816927b7b3
      https://github.com/llvm/llvm-project/commit/c4842bb2e98e2f1ee23bb3bc753752816927b7b3
  Author: Marco Elver <elver at google.com>
  Date:   2022-09-07 (Wed, 07 Sep 2022)

  Changed paths:
    M clang/include/clang/Basic/CodeGenOptions.def
    M clang/include/clang/Basic/CodeGenOptions.h
    M clang/include/clang/Driver/Options.td
    M clang/include/clang/Driver/SanitizerArgs.h
    M clang/lib/CodeGen/BackendUtil.cpp
    M clang/lib/Driver/SanitizerArgs.cpp
    A clang/test/CodeGen/sanitize-metadata.c
    A clang/test/Driver/fsanitize-metadata.c

  Log Message:
  -----------
  [Clang] Introduce -fexperimental-sanitize-metadata=

Introduces the frontend flag -fexperimental-sanitize-metadata=, which
enables SanitizerBinaryMetadata instrumentation.

The first intended user of the binary metadata emitted will be a variant
of GWP-TSan [1]. The plan is to open source a stable and production
quality version of GWP-TSan. The development of which, however, requires
upstream compiler support.

[1] https://llvm.org/devmtg/2020-09/slides/Morehouse-GWP-Tsan.pdf

Until the tool has been open sourced, we mark this kind of
instrumentation as "experimental", and reserve the option to change
binary format, remove features, and similar.

Reviewed By: vitalybuka, MaskRay

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


Compare: https://github.com/llvm/llvm-project/compare/8d2a447bf927...c4842bb2e98e


More information about the All-commits mailing list