llvm-project/clang/lib/Frontend
serge_sans_paille e67cbac812 Support -fstack-clash-protection for x86
Implement protection against the stack clash attack [0] through inline stack
probing.

Probe stack allocation every PAGE_SIZE during frame lowering or dynamic
allocation to make sure the page guard, if any, is touched when touching the
stack, in a similar manner to GCC[1].

This extends the existing `probe-stack' mechanism with a special value `inline-asm'.
Technically the former uses function call before stack allocation while this
patch provides inlined stack probes and chunk allocation.

Only implemented for x86.

[0] https://www.qualys.com/2017/06/19/stack-clash/stack-clash.txt
[1] https://gcc.gnu.org/ml/gcc-patches/2017-07/msg00556.html

This a recommit of 39f50da2a3 with proper LiveIn
declaration, better option handling and more portable testing.

Differential Revision: https://reviews.llvm.org/D68720
2020-02-09 10:42:45 +01:00
..
Rewrite Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
ASTConsumers.cpp [Clang] Migrate llvm::make_unique to std::make_unique 2019-08-14 23:04:18 +00:00
ASTMerge.cpp [ASTImporter] Mark erroneous nodes in shared st 2019-07-01 15:37:07 +00:00
ASTUnit.cpp Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
CMakeLists.txt Move LangStandard*, InputKind::Language to Basic 2019-08-05 13:59:26 +00:00
ChainedDiagnosticConsumer.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ChainedIncludesSource.cpp Avoid including Builtins.h in Preprocessor.h 2019-11-15 16:45:16 -08:00
CompilerInstance.cpp Use heterogenous lookup for std;:map<std::string with a StringRef. NFCI. 2020-02-08 13:28:29 +01:00
CompilerInvocation.cpp Support -fstack-clash-protection for x86 2020-02-09 10:42:45 +01:00
CreateInvocationFromCommandLine.cpp [clangd] Log cc1 args at verbose level. 2019-11-29 11:00:01 +01:00
DependencyFile.cpp Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
DependencyGraph.cpp Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
DiagnosticRenderer.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
FrontendAction.cpp Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
FrontendActions.cpp Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
FrontendOptions.cpp Move LangStandard*, InputKind::Language to Basic 2019-08-05 13:59:26 +00:00
FrontendTiming.cpp Fix file headers. NFC 2019-03-01 06:49:51 +00:00
HeaderIncludeGen.cpp [Clang] Migrate llvm::make_unique to std::make_unique 2019-08-14 23:04:18 +00:00
InitHeaderSearch.cpp Fix more implicit conversions. Getting closer to having clang working with gcc 5 again 2020-01-29 02:57:59 +01:00
InitPreprocessor.cpp Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
InterfaceStubFunctionsConsumer.cpp [clang][IFS] Prevent Clang-IFS from Leaking symbols from inside a block. 2020-01-13 16:04:27 -05:00
LayoutOverrideSource.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
LogDiagnosticPrinter.cpp Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
ModuleDependencyCollector.cpp Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
MultiplexConsumer.cpp [AST] Add missing MultiplexConsumer::CompleteExternalDeclaration 2019-12-22 19:00:48 -08:00
PrecompiledPreamble.cpp Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
PrintPreprocessedOutput.cpp [Clang] Migrate llvm::make_unique to std::make_unique 2019-08-14 23:04:18 +00:00
SerializedDiagnosticPrinter.cpp [Clang] Migrate llvm::make_unique to std::make_unique 2019-08-14 23:04:18 +00:00
SerializedDiagnosticReader.cpp Bitstream reader: Fix undefined behavior seen after rL364464 2019-07-05 20:22:40 +00:00
TestModuleFileExtension.cpp [Bitcode] Move Bitstream to a separate library 2019-07-03 22:40:07 +00:00
TestModuleFileExtension.h [Bitcode] Move Bitstream to a separate library 2019-07-03 22:40:07 +00:00
TextDiagnostic.cpp [clang] Fix the canonicalization of paths in -fdiagnostics-absolute-paths 2019-12-20 09:16:33 +01:00
TextDiagnosticBuffer.cpp Fix more implicit conversions. Getting closer to having clang working with gcc 5 again 2020-01-29 02:57:59 +01:00
TextDiagnosticPrinter.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
VerifyDiagnosticConsumer.cpp Introduce FileEntryRef and use it when handling includes to report correct dependencies 2019-08-22 18:15:50 +00:00