aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/ObjectFilePCHContainerOperations.cpp
diff options
context:
space:
mode:
authorKristof Beyls <kristof.beyls@arm.com>2020-06-11 07:42:16 +0100
committerKristof Beyls <kristof.beyls@arm.com>2020-06-11 07:51:17 +0100
commit0ee176edc8b4a6f20527e907bfd026b07a27e7ef (patch)
tree457a454f20ea3eac71197cdae41ec344f7a39f29 /clang/lib/CodeGen/ObjectFilePCHContainerOperations.cpp
parent6b8628a1f036bc34cb0499e15da6df9a130ec287 (diff)
downloadllvm-0ee176edc8b4a6f20527e907bfd026b07a27e7ef.zip
llvm-0ee176edc8b4a6f20527e907bfd026b07a27e7ef.tar.gz
llvm-0ee176edc8b4a6f20527e907bfd026b07a27e7ef.tar.bz2
[AArch64] Introduce AArch64SLSHardeningPass, implementing hardening of RET and BR instructions.
Some processors may speculatively execute the instructions immediately following RET (returns) and BR (indirect jumps), even though control flow should change unconditionally at these instructions. To avoid a potential miss-speculatively executed gadget after these instructions leaking secrets through side channels, this pass places a speculation barrier immediately after every RET and BR instruction. Since these barriers are never on the correct, architectural execution path, performance overhead of this is expected to be low. On targets that implement that Armv8.0-SB Speculation Barrier extension, a single SB instruction is emitted that acts as a speculation barrier. On other targets, a DSB SYS followed by a ISB is emitted to act as a speculation barrier. These speculation barriers are implemented as pseudo instructions to avoid later passes to analyze them and potentially remove them. Even though currently LLVM does not produce BRAA/BRAB/BRAAZ/BRABZ instructions, these are also mitigated by the pass and tested through a MIR test. The mitigation is off by default and can be enabled by the harden-sls-retbr subtarget feature. Differential Revision: https://reviews.llvm.org/D81400
Diffstat (limited to 'clang/lib/CodeGen/ObjectFilePCHContainerOperations.cpp')
0 files changed, 0 insertions, 0 deletions