arm-trusted-firmware/include
Anthony Steinhauser f461fe346b Prevent speculative execution past ERET
Even though ERET always causes a jump to another address, aarch64 CPUs
speculatively execute following instructions as if the ERET
instruction was not a jump instruction.
The speculative execution does not cross privilege-levels (to the jump
target as one would expect), but it continues on the kernel privilege
level as if the ERET instruction did not change the control flow -
thus execution anything that is accidentally linked after the ERET
instruction. Later, the results of this speculative execution are
always architecturally discarded, however they can leak data using
microarchitectural side channels. This speculative execution is very
reliable (seems to be unconditional) and it manages to complete even
relatively performance-heavy operations (e.g. multiple dependent
fetches from uncached memory).

This was fixed in Linux, FreeBSD, OpenBSD and Optee OS:
679db70801
29fb48ace4
3a08873ece
abfd092aa1

It is demonstrated in a SafeSide example:
https://github.com/google/safeside/blob/master/demos/eret_hvc_smc_wrapper.cc
https://github.com/google/safeside/blob/master/kernel_modules/kmod_eret_hvc_smc/eret_hvc_smc_module.c

Signed-off-by: Anthony Steinhauser <asteinhauser@google.com>
Change-Id: Iead39b0b9fb4b8d8b5609daaa8be81497ba63a0f
2020-01-22 21:42:51 +00:00
..
arch Prevent speculative execution past ERET 2020-01-22 21:42:51 +00:00
bl1 Replace __ASSEMBLY__ with compiler-builtin __ASSEMBLER__ 2019-08-01 13:14:12 -07:00
bl2 BL2_AT_EL3: Enable pointer authentication support 2019-02-27 11:58:09 +00:00
bl2u Standardise header guards across codebase 2018-11-08 10:20:19 +00:00
bl31 Replace __ASSEMBLY__ with compiler-builtin __ASSEMBLER__ 2019-08-01 13:14:12 -07:00
bl32 Replace __ASSEMBLY__ with compiler-builtin __ASSEMBLER__ 2019-08-01 13:14:12 -07:00
common Add fdt_add_reserved_memory() helper function 2019-09-13 16:54:21 +01:00
drivers spi: stm32_qspi: Add QSPI support 2020-01-20 11:32:59 +01:00
dt-bindings stm32mp1: update device tree files 2019-01-18 15:45:08 +01:00
export Unify type of "cpu_idx" across PSCI module. 2020-01-10 17:11:51 +00:00
lib lib: utils_def: add CLAMP macro 2020-01-20 11:32:59 +01:00
plat a8k: Implement platform specific power off 2020-01-15 07:31:43 +01:00
services spm-mm: Remove mm_svc.h header 2019-12-20 16:04:01 +00:00
tools_share Sanitise includes across codebase 2019-01-04 10:43:17 +00:00