switch-l4t-atf/services/std_svc/spm_mm
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
..
aarch64 Prevent speculative execution past ERET 2020-01-22 21:42:51 +00:00
spm_mm_main.c spm-mm: Rename source files 2019-12-20 16:04:35 +00:00
spm_mm_private.h spm-mm: Rename spm_private.h 2019-12-20 16:04:20 +00:00
spm_mm_setup.c spm-mm: Rename source files 2019-12-20 16:04:35 +00:00
spm_mm_shim_private.h spm-mm: Rename spm_shim_private.h 2019-12-20 16:04:27 +00:00
spm_mm_xlat.c spm-mm: Rename source files 2019-12-20 16:04:35 +00:00
spm_mm.mk spm-mm: Rename aarch64 assembly files 2019-12-20 16:04:49 +00:00