[all-commits] [llvm/llvm-project] eb2a57: Add generic KCFI operand bundle lowering

Sami Tolvanen via All-commits all-commits at lists.llvm.org
Thu Nov 17 14:10:29 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: eb2a57ebc7aaad551af30462097a9e06c96db925
      https://github.com/llvm/llvm-project/commit/eb2a57ebc7aaad551af30462097a9e06c96db925
  Author: Sami Tolvanen <samitolvanen at google.com>
  Date:   2022-11-17 (Thu, 17 Nov 2022)

  Changed paths:
    M clang/lib/CodeGen/BackendUtil.cpp
    M clang/lib/Driver/ToolChain.cpp
    M llvm/include/llvm/InitializePasses.h
    A llvm/include/llvm/Transforms/Instrumentation/KCFI.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/KCFI.cpp
    A llvm/test/Transforms/KCFI/kcfi-patchable-function-prefix.ll
    A llvm/test/Transforms/KCFI/kcfi-supported.ll
    A llvm/test/Transforms/KCFI/kcfi.ll
    M llvm/utils/gn/secondary/llvm/lib/Transforms/Instrumentation/BUILD.gn

  Log Message:
  -----------
  Add generic KCFI operand bundle lowering

The KCFI sanitizer emits "kcfi" operand bundles to indirect
call instructions, which the LLVM back-end lowers into an
architecture-specific type check with a known machine instruction
sequence. Currently, KCFI operand bundle lowering is supported only
on 64-bit X86 and AArch64 architectures.

As a lightweight forward-edge CFI implementation that doesn't
require LTO is also useful for non-Linux low-level targets on
other machine architectures, add a generic KCFI operand bundle
lowering pass that's only used when back-end lowering support is not
available and allows -fsanitize=kcfi to be enabled in Clang on all
architectures.

Reviewed By: nickdesaulniers, MaskRay

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




More information about the All-commits mailing list