Control-Flow Enforcement Technology - Shadow Stack and Indirect Branch Tracking suppo...
authorOren Ben Simhon <oren.ben.simhon@intel.com>
Sun, 26 Nov 2017 12:34:54 +0000 (12:34 +0000)
committerOren Ben Simhon <oren.ben.simhon@intel.com>
Sun, 26 Nov 2017 12:34:54 +0000 (12:34 +0000)
commitfec21ec0c6257eb24290c483b03b4fd9e6a9d0d1
tree8e434b1221c6f9237f53017ab6241d8fb5e69360
parent20e97ae9a06b8869e7fe3aa7bfff4b5549c8bcf3
Control-Flow Enforcement Technology - Shadow Stack and Indirect Branch Tracking support (Clang side)

Shadow stack solution introduces a new stack for return addresses only.
The stack has a Shadow Stack Pointer (SSP) that points to the last address to which we expect to return.
If we return to a different address an exception is triggered.
This patch includes shadow stack intrinsics as well as the corresponding CET header.
It includes CET clang flags for shadow stack and Indirect Branch Tracking.

For more information, please see the following:
https://software.intel.com/sites/default/files/managed/4d/2a/control-flow-enforcement-technology-preview.pdf

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

Change-Id: I79ad0925a028bbc94c8ecad75f6daa2f214171f1
llvm-svn: 318995
12 files changed:
clang/include/clang/Basic/BuiltinsX86.def
clang/include/clang/Basic/BuiltinsX86_64.def
clang/include/clang/Driver/Options.td
clang/lib/Basic/Targets/X86.cpp
clang/lib/Basic/Targets/X86.h
clang/lib/Headers/CMakeLists.txt
clang/lib/Headers/cetintrin.h [new file with mode: 0644]
clang/lib/Headers/immintrin.h
clang/test/CodeGen/builtins-x86.c
clang/test/CodeGen/cetintrin.c [new file with mode: 0644]
clang/test/Driver/x86-target-features.c
clang/test/Preprocessor/x86_target_features.c